﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="recordabsolute2UserControl.ascx.cs"
    Inherits="EMANIFEST.PROFILE.recordabsolute2.recordabsolute2UserControl" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="~/_controltemplates/Emanifest_UI/UploadFile.ascx" TagName="UploadFile"
    TagPrefix="uc1" %>
<link href="/_layouts/emanifest/Css/validationEngine.jquery.css" rel="stylesheet"
    type="text/css" />
<link href="/_layouts/emanifest/Css/template.css" rel="stylesheet" type="text/css" />
<script src="/_layouts/emanifest/js/jquery.blockUI.js" type="text/javascript"></script>
<script src="/_layouts/emanifest/js/languages/jquery.validationEngine-vn.js" type="text/javascript"
    charset="utf-8"></script>
<script src="/_layouts/emanifest/js/jquery.validationEngine.js" type="text/javascript"
    charset="utf-8"></script>
<script language="javascript" type="text/javascript">
    jQuery(document).ready(function () {
        // binds form submission and fields to the validation engine
        jQuery("#aspnetForm").validationEngine();
        //        BlockUI("<%#pnlAddCrew.ClientID %>");
        //        $.blockUI.defaults.css = {};
        $('#imgAddGoodDecralation').click(function () {
            $('#divGoodDecralation').fadeToggle();
            $('#<%=divEditGoodDecralation.ClientID %>').fadeToggle();
        });
        $('#btnGoodDecralationCancel').click(function () {
            $('#divGoodDecralation').fadeToggle();
            $('#<%=divEditGoodDecralation.ClientID %>').fadeToggle();
        });
        
    });
    function lnkAdd_OnClientClick() {
        jQuery('<%=txtCrewId.ClientID %>').val('');
        jQuery('<%=txtCrewEffectId.ClientID %>').val('');
    }

    function btnCancel_OnClientClick() {
        //     jQuery('#aspnetForm').validationEngine('hide');
        //        $find('ctl00_ctl26_wPshipList_ctl00_tabDocument_TabPanel3_popupCrew').hide();
        //        $find('ctl00_ctl26_wPshipList_ctl00_tabDocument_TabPanel4_popupCrewEffect').hide();

        $find('<%=popupGoodDecralation.ClientID %>').hide();        
        $find('<%=popupHouseBill.ClientID %>').hide();
        $find('popupGeneralDecralation').hide();
        $find('<%=popupCrew.ClientID %>').hide();
        $find('<%=popupCrewEffect.ClientID %>').hide();
        $find('<%=popupShipStore.ClientID %>').hide();
        $find('<%=popupPassenger.ClientID %>').hide();
        $find('<%=popupDangerousGood.ClientID %>').hide();
        $find('<%=popupDangerousGoodItem.ClientID %>').hide();
        return false;
    }

    function lnkGeneralDecralation_OnClientClick() {
        $find('popupGeneralDecralation').show();
    }

    function BlockUI(elementID) {
        var prm = Sys.WebForms.PageRequestManager.getInstance();
        prm.add_beginRequest(function () {
            $("#" + elementID).block({ message: '<table align = "center"><tr><td>' +
     '<img src="/_layouts/emanifest/images/loadingAnim.gif"/></td></tr></table>',
                css: {},
                overlayCSS: { backgroundColor: '#000000', opacity: 0.6
                }
            });
        });
        prm.add_endRequest(function () {
            $("#" + elementID).unblock();
        });
    }
</script>
<script language="javascript" type="text/javascript">
    function expandcollapse(obj, row) {
        var div = document.getElementById(obj);
        var img = document.getElementById('img' + obj);


        if (div.style.display == "none") {
            div.style.display = "block";
            if (row == 'alt') {
                img.src = "~/layouts/emanifest/minus.png";
            }
            else {
                img.src = "~/layouts/emanifest/minus.png";
            }
            img.alt = "Close to view other Customers";
        }
        else {
            div.style.display = "none";
            if (row == 'alt') {
                img.src = "~/layouts/emanifest/plus.png";
            }
            else {
                img.src = "~/layouts/emanifest/plus.png";
            }
            img.alt = "Expand to show Orders";
        }
    } 
</script>
<script language="javascript" type="text/javascript">
    function clientActiveTabChanged(sender, args) {
        // Post back if it is the 3rd tab (0 based)
        //        if (sender.get_activeTabIndex() == 7) { //Master Bill
        //            __doPostBack('<%= this.btnMasterBillTrigger.UniqueID %>', '');
        //        }
        var tab = sender.get_activeTabIndex();
        var tabLoadedVal = parseInt($("#txtTabLoaded").val());
        var tabLoadedBit = 0;
        switch (tab) {
            case 0: tabLoadedBit = 1; break;
            case 1: tabLoadedBit = 1 << 1; break;
            case 2: tabLoadedBit = 1 << 2; break;
            case 3: tabLoadedBit = 1 << 3; break;
            case 4: tabLoadedBit = 1 << 4; break;
            case 5: tabLoadedBit = 1 << 5; break;
            case 6: tabLoadedBit = 1 << 6; break;
            case 7: tabLoadedBit = 1 << 7; break;
            case 8: tabLoadedBit = 1 << 8; break;
            case 9: tabLoadedBit = 1 << 9; break;
            case 10: tabLoadedBit = 1 << 10; break;
        }


        if ((tabLoadedVal & tabLoadedBit) != tabLoadedBit) {
            tabLoadedVal += tabLoadedBit;
            $("#txtTabLoaded").val(tabLoadedVal);
            switch (tab) {
                case 0: __doPostBack('<%= this.btnGoodDecralationTrigger.UniqueID %>', ''); break;
                case 1: __doPostBack('<%= this.btnHouseBillTrigger.UniqueID %>', ''); break;
                case 2: __doPostBack('<%= this.btnGeneralDeclarationTrigger.UniqueID %>', ''); break;                    
                case 3: __doPostBack('<%= this.btnCrewsTrigger.UniqueID %>', ''); break;
                case 4: __doPostBack('<%= this.btnCrewEffectTrigger.UniqueID %>', ''); break;
                case 5: __doPostBack('<%= this.btnShipStoreTrigger.UniqueID %>', ''); break;
                case 6: __doPostBack('<%= this.btnPassengerTrigger.UniqueID %>', ''); break;
                case 7: __doPostBack('<%= this.btnDangerousGoodTrigger.UniqueID %>', ''); break;
                case 8: __doPostBack('<%= this.btnMasterBillTrigger.UniqueID %>', ''); break;
                case 9: __doPostBack('<%= this.btnImgMasterBillTrigger.UniqueID %>', ''); break;
                case 10: __doPostBack('<%= this.btnImgHouseBillTrigger.UniqueID %>', ''); break;
            }
        }
    }

</script>
<script language="javascript" type="text/javascript">
    function TextChange(id, val) {
        var idRO = "#" + id + "RO";
        $(idRO).val(val);
    }

    function btnUpdateGoodDecralation_OnClientClick() {
        $('#divGoodDecralation').fadeToggle();
        $('#<%=divEditGoodDecralation.ClientID %>').fadeToggle();
    }

    function lnkCancelHouseBillItem_OnClientClick(vdgroup) {
        
    }
</script>

<style type="text/css">
#divEditGoodDecralation input
{
    padding: 0 20px 0 10px;
    margin: 0 10px 0 10px;
}

.ajax__tab_xp .ajax__tab_header {white-space:normal;} 
.customBody { overflow:visible; }
</style>


<input id="txtTabLoaded" type="text" style="display: none; height: 10px" value="0" />
<input id="btnGoodDecralationTrigger" runat="server" style="display: none;" type="button"
    onserverclick="btnGoodDecralationTrigger_Click" />
<input id="btnHouseBillTrigger" runat="server" style="display: none;" type="button"
    onserverclick="btnHouseBillTrigger_Click" />
<input id="btnGeneralDeclarationTrigger" runat="server" style="display: none;" type="button"
    onserverclick="btnGeneralDeclarationTrigger_Click" />
<input id="btnCrewsTrigger" runat="server" style="display: none;" type="button" onserverclick="btnCrewsTrigger_Click" />
<input id="btnCrewEffectTrigger" runat="server" style="display: none;" type="button"
    onserverclick="btnCrewEffectTrigger_Click" />
<input id="btnShipStoreTrigger" runat="server" style="display: none;" type="button"
    onserverclick="btnShipStoreTrigger_Click" />
<input id="btnPassengerTrigger" runat="server" style="display: none;" type="button"
    onserverclick="btnPassengerTrigger_Click" />
<input id="btnDangerousGoodTrigger" runat="server" style="display: none;" type="button"
    onserverclick="btnDangerousGoodTrigger_Click" />
<input id="btnMasterBillTrigger" runat="server" style="display: none;" type="button"
    onserverclick="btnMasterBillTrigger_Click" />
<input id="btnImgMasterBillTrigger" runat="server" style="display: none;" type="button"
    onserverclick="btnImgMasterBillTrigger_Click" />
<input id="btnImgHouseBillTrigger" runat="server" style="display: none;" type="button"
    onserverclick="btnImgHouseBillTrigger_Click" />
<div class="headerpage">
    <div class="title left">
        Xem hồ sơ</div>
</div>
<div class="clearfix">
</div>
<div class="content">
    <div>
        <div class="wrapper">
            <div class="label_english_left">
                <label class="label_vietnam">Tên hồ sơ:</label><br />
                <label  class="label_english">(Document Name)</label>
            </div>
            <div class="label_english_left">
                <asp:Label runat="server" ID="lblDocument"></asp:Label>
                <asp:HiddenField ID="hfDocumentID" runat="server" />
                <asp:HiddenField ID="hfItemId" runat="server" />
            </div>
        </div>
        <div style="clear:both"></div>
        <div class="wrapper">
            <div class="label_english_left">
                <b><asp:Literal runat="server" ID="Literal12" Text="Tên tàu:"></asp:Literal></b>
                <br />
                <label class="label_english">(Name of ship)</label>
                <br />
                <b><asp:Literal runat="server" ID="ltrName2" Text="Cảng rời/đến:"></asp:Literal></b>
                <br /><label class="label_english">(Port of arrival/departure)</label>
            </div>
            <div class="label_english_left">
                <asp:Label runat="server" ID="lblShip"></asp:Label>
                <br /><br />
                <asp:Label runat="server" ID="lblPort"></asp:Label>
            </div>
            <div class="label_english_left">
                <b><asp:Literal runat="server" ID="Literal15" Text="Thuyền trưởng:"></asp:Literal></b>
                <br /><label class="label_english">(Name of master)</label>
                <br />
                <b><asp:Literal runat="server" ID="ltrName4" Text="Thời gian đến:"></asp:Literal></b>
                <br /><label class="label_english">(Date - Time of arrival/departure)</label>
            </div>
            <div class="label_english_left">
                <asp:Label runat="server" ID="lblMasterName"></asp:Label>
                <br /><br />
                 <asp:Label runat="server" ID="lblArriveTime"></asp:Label>
            </div>
        </div>
        <div style="clear:both"></div>


    </div>
    <div class="content">
        <asp:TabContainer ID="tabDocument" runat="server" Width="100%" CssClass="ajax__tab_xp" 
            AutoPostBack="false" OnClientActiveTabChanged="clientActiveTabChanged" 
            ActiveTabIndex="1">
            <asp:TabPanel ID="TabPanel1" runat="server" HeaderText="Bản khai hàng hóa" Enabled="true" ToolTip="Goods Declaration">
                <ContentTemplate>
                    <div>
                        <uc1:UploadFile ID="upFileGoodDecralation" runat="server" />
                    </div>
                    <asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpdatePanel21">
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btnGoodDecralationTrigger" />
                            <asp:AsyncPostBackTrigger ControlID="btnUpdateGoodDecralation" />                            
                        </Triggers>
                    <ContentTemplate>
                     <asp:Label runat="server" ID="lblGoodDecralationStatus" Text="Loading..."></asp:Label>
                        <div id="divGoodDecralation">
                        <img id="imgAddGoodDecralation" src="/_layouts/emanifest/edit.png" alt="Thêm bản khai hàng hóa" /><label class="b">Bản khai hàng hóa: </label> <br /><label class="i">(Goods Declaration)</label>
                        </div>
                        <div class="wrapper">
                            <div class="left">
                                <asp:Label ID="Label21" runat="server" Text="Tổng số kiện và loại kiện:" CssClass="label_vietnam"/>
                                <br /><label  class="label_english">(Number and kind of packages)</label>
                                <br />
                                <asp:Label ID="Label22" runat="server" Text="Thông tin kiện hàng hóa:" CssClass="label_vietnam" />
                                <br /><label  class="label_english">(Information packages goods)</label>
                            </div>
                            <div class="left">
                                <asp:Label runat="server" ID="lblGoodDecNumberOfPackage"></asp:Label>
                                <br /><br />
                                <asp:Label runat="server" ID="lblKindOfPackages"></asp:Label> 
                            </div>
                        </div>
                        <div style="clear:both"></div>


                        <div id="divEditGoodDecralation" runat="server" style="display: none">
                            <fieldset>
                                <legend>
                                    <asp:Label ID="Label23" runat="server" Text="Thông tin về bản khai hàng hóa" />
                                </legend>
                                <div class="label">
                                    <asp:Label ID="lblGoodDecNumberOfPackage0" runat="server" Text="Tổng số kiện và loại kiện" />

                                 </div>
                                <asp:TextBox runat="server" ID="txtGoodDecNumberOfPackage0" CssClass="w200  validate[required] text-input"></asp:TextBox>
                                <div class="label">
                                    <asp:Label ID="lblKindOfPackages0" runat="server" Text="Thông tin kiện hàng hóa" /></div>
                                <asp:TextBox runat="server" ID="txtKindOfPackages0" CssClass="w500" Rows="4" TextMode="MultiLine"></asp:TextBox>
                            </fieldset>
                            <fieldset>
                                <asp:TextBox runat="server" ID="txtGoodDecralationId" ReadOnly="true" Visible="false" />
                                <asp:Label runat="server" ID="lblGoodDecralationError"></asp:Label>
                                <br />
                                <asp:Button CssClass="button submit" ID="btnUpdateGoodDecralation" CommandName="Update"
                                    runat="server" Text="Cập nhật" OnClick="btnUpdateGoodDecralation_Click" OnClientClick="btnUpdateGoodDecralation_OnClientClick()" />
                                <input type="button" class="button" id="btnGoodDecralationCancel" value="Bỏ qua" />
                            </fieldset>
                        </div>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                    
                    <asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpdatePanel2">
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="grdGoodDecralationItem" />
                            <asp:AsyncPostBackTrigger ControlID="btnUpdateGoodDecralationItem" />
                        </Triggers>

                        <ContentTemplate>
                            <asp:Label runat="server" ID="lblGoodDecralationLoadStatus"></asp:Label>                           
                            <%-- <asp:ImageButton ID="lnkAddGoodDecralationItem" runat="server" Text="Add" OnClick="lnkAddGoodDecralationItem_Click"
                                ImageUrl="/_layouts/emanifest/add.png" ToolTip="Thêm hàng hóa" />--%>Thông tin về hàng hóa<label class="label_english">(Information on goods )</label>
                           
                            <asp:GridView runat="server" ID="grdGoodDecralationItem" AutoGenerateColumns="False" Width="100%"
                                CssClass="Grid GridStyle" GridLines="Both" AllowPaging="true" PageSize="20" EnableModelValidation="True"                                
                                DataKeyNames="GoodItemId"
                                OnRowCommand="grdGoodDecralationItem_RowCommand">
                                <PagerSettings Mode="NumericFirstLast" PageButtonCount="10" FirstPageText="Trang đầu"
                                    LastPageText="Trang cuối" />
                                <RowStyle CssClass="GridItem" />
                                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                <PagerStyle CssClass="GridPager" />
                                <HeaderStyle CssClass="GridHeader"/>
                                <AlternatingRowStyle CssClass="GridAlternatingItem" />
                                <Columns>
                                    <asp:BoundField DataField="MasterBillNo" HeaderText="Vận đơn số"/>                                        
                                    <asp:BoundField DataField="Consigner" HeaderText="Người gửi"  HtmlEncode="true"/>                                      
                                    <asp:BoundField DataField="Consignee" HeaderText="Người nhận" HtmlEncode="true"/>                                        
                                    <asp:BoundField DataField="NotificatedParty" HeaderText="Người được thông báo" HtmlEncode="true"/>                                       
                                    <asp:BoundField DataField="ContNumber" HeaderText="Số hiệu cont"/>                                 
                                    <asp:BoundField DataField="ContSealNumber" HeaderText="Số seal cont"/>                                        
                                    <asp:BoundField DataField="GoodDescription" HeaderText="Tên hàng/mô tả hàng hóa" HtmlEncode="true"/>                                        
                                    <asp:BoundField DataField="NetWeight" HeaderText="Trọng lượng tịnh" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="40px"/>                                        
                                    <asp:BoundField DataField="GrossWeight" HeaderText="Tổng trọng lượng" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="40px"/>                                        
                                    <asp:BoundField DataField="Demension" HeaderText="Kích thước/ thể tích" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="40px"/>
                                </Columns>
                            </asp:GridView>
                            <asp:ObjectDataSource ID="odsHangHoa" runat="server" SelectMethod="GetGoodItemPagingByDocumentId"
                                EnablePaging="true" TypeName="EMANIFEST.BusinessObjects.Controllers.DocumentControler"
                                StartRowIndexParameterName="startIndex" MaximumRowsParameterName="pageSize" SelectCountMethod="GetGoodItemNumberByDocumentId"
                                OnSelecting="odsHangHoa_Selecting"></asp:ObjectDataSource>
                            <asp:Button CssClass="button" ID="btnShowPopupGoodDecralation" runat="server" Style="display: none" />
                            <asp:ModalPopupExtender ID="popupGoodDecralation" runat="server" TargetControlID="btnShowPopupGoodDecralation"
                                PopupControlID="pnlAddGoodDecralation" BackgroundCssClass="modalBackground" DropShadow="false">
                            </asp:ModalPopupExtender>
                            <div>
                                <asp:Panel ID="pnlAddGoodDecralation" runat="server" CssClass="popup" Style="display: none">
                                    <div class="two-columns">
                                        <fieldset>
                                            <legend>
                                                <asp:Label ID="Label20" runat="server" Text="Thông tin về hàng hóa" />
                                            </legend>
                                            <div class="left-column">
                                                <p>
                                                    <asp:Label ID="lblGoodDecMasterBillNo" runat="server" AssociatedControlID="txtGoodDecMasterBillNo"
                                                        Text="Vận đơn số" CssClass="label required" />
                                                        <label class="label_english">(B/L No)</label>
                                                </p>
                                                <asp:TextBox runat="server" ID="txtGoodDecMasterBillNo" CssClass="w200  validate[required] text-input"></asp:TextBox>
                                             
                                                <p>
                                                    <asp:Label ID="lblGoodDecContNumber" runat="server" AssociatedControlID="txtGoodDecContNumber"
                                                        Text="Số hiệu container" CssClass="label required" />
                                                        <label class="label_english">(Cont's number )</label>
                                                        </p>
                                                <asp:TextBox runat="server" ID="txtGoodDecContNumber" CssClass="w200 validate[required] text-input"></asp:TextBox>
                                                <p>
                                                    <asp:Label ID="lblGoodDecContSealNumber" runat="server" AssociatedControlID="txtGoodDecContSealNumber"
                                                        Text="Số niêm phong container" CssClass="label required" />
                                                        <label class="label_english">(Seal number)</label>
                                                        </p>
                                                <asp:TextBox runat="server" ID="txtGoodDecContSealNumber" CssClass="w200 validate[required]"></asp:TextBox>
                                                <p>
                                                    <asp:Label ID="lblGoodDecNetWeight" runat="server" AssociatedControlID="txtGoodDecNetWeight"
                                                        Text="Trọng lượng tịnh" CssClass="label required" />
                                                        <label class="label_english">(Net weight)</label>
                                                        </p>
                                                <asp:TextBox runat="server" ID="txtGoodDecNetWeight" CssClass="w100 validate[required]"></asp:TextBox>
                                                <p>
                                                    <asp:Label ID="lblGoodDecGrossWeight" runat="server" AssociatedControlID="txtGoodDecGrossWeight"
                                                        Text="Tổng trọng lượng" CssClass="label required" />
                                                        <label class="label_english">(Gross weight)</label>
                                                        </p>
                                                <asp:TextBox runat="server" ID="txtGoodDecGrossWeight" CssClass="w100 validate[required]"></asp:TextBox>
                                                <p>
                                                    <asp:Label ID="lblGoodDecDemension" runat="server" AssociatedControlID="txtGoodDecDemension"
                                                        Text="Kích thước/Thể tích" CssClass="label required" />
                                                        <label class="label_english">(Demension /tonnage)</label>
                                                        </p>
                                                <asp:TextBox runat="server" ID="txtGoodDecDemension" CssClass="w100 validate[required]"></asp:TextBox>                                                
                                            </div>
                                            <div class="right-column">
                                                <p>
                                                    <asp:Label ID="lblGoodDecGoodDescription" runat="server" AssociatedControlID="txtGoodDecGoodDescription"
                                                        Text="Tên hàng/mô tả hàng hóa" CssClass="label required" />
                                                        <label class="label_english">(Name, Discription of goods)</label>
                                                        </p>
                                                <asp:TextBox runat="server" ID="txtGoodDecGoodDescription" CssClass="validate[required] text-input" Rows="2" TextMode="MultiLine"></asp:TextBox>
                                                 <p>
                                                    <asp:Label ID="lblGoodDecConsigner" runat="server" AssociatedControlID="txtGoodDecConsigner"
                                                        Text="Người gửi hàng" CssClass="label required" />
                                                        <label class="label_english">(Consigner)</label>
                                                </p>
                                                <asp:TextBox runat="server" ID="txtGoodDecConsigner" CssClass="validate[required]" Rows="2" TextMode="MultiLine"></asp:TextBox>
                                                <p>
                                                    <asp:Label ID="lblGoodDecConsignee" runat="server" AssociatedControlID="txtGoodDecConsignee"
                                                        Text="Người nhận hàng" CssClass="label required" />
                                                        <label class="label_english">(Consignee)</label>
                                                </p>
                                                <asp:TextBox runat="server" ID="txtGoodDecConsignee" CssClass="validate[required]"  Rows="2" TextMode="MultiLine"></asp:TextBox>
                                                <p>
                                                    <asp:Label ID="lblGoodDecNotificatedParty" runat="server" AssociatedControlID="txtGoodDecNotificatedParty"
                                                        Text="Người được thông báo" CssClass="label required" />
                                                        <label class="label_english">(Notificated party)</label>
                                                </p>
                                                <asp:TextBox runat="server" ID="txtGoodDecNotificatedParty" CssClass="validate[required]"  Rows="2" TextMode="MultiLine"></asp:TextBox>
                                            </div>
                                        </fieldset>

                                        <fieldset>
                                            <asp:TextBox runat="server" ID="txtGoodDecralationItemId" ReadOnly="true" Visible="false" />
                                            <asp:Label runat="server" ID="lblGoodDecralationItemError"></asp:Label>
                                            <br />
                                            <asp:Button CssClass="button submit" ID="btnUpdateGoodDecralationItem" CommandName="Update"
                                                runat="server" Text="Cập nhật" OnClick="btnUpdateGoodDecralationItem_Click" />
                                            <asp:Button CssClass="button" ID="btnGoodDecralationItemCancel" runat="server" Text="Bỏ qua"
                                                OnClientClick="btnCancel_OnClientClick(); return false;" />
                                        </fieldset>
                                    </div>
                                </asp:Panel>
                            </div>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                    </div>
                </ContentTemplate>
            </asp:TabPanel>


            <asp:TabPanel ID="TabPanel11" runat="server" HeaderText="Vận đơn gom hàng " Enabled="true" ToolTip="House bill of lading">
                <HeaderTemplate>
                    Vận đơn gom hàng
                </HeaderTemplate>
                <ContentTemplate>
                    <div>
                        <uc1:UploadFile ID="upFileHouseBill" runat="server" />
                    </div>
                    <asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpdatePanel11">
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btnHouseBillTrigger" />
                            <asp:AsyncPostBackTrigger ControlID="grdHouseBill" />
                            <asp:AsyncPostBackTrigger ControlID="btnUpdateHouseBill" />
                        </Triggers>
                        <ContentTemplate>
                            <asp:Label runat="server" ID="lblHouseBillLoadStatus" Text="Loading..."></asp:Label>
                            <label class="label_vietnam">Vận đơn gom hàng:</label><br /><label class="label_english">(House bill of lading)</label>
                            <asp:ImageButton ID="lnkAddHouseBill" runat="server" Text="Add"
                                OnClick="lnkAddHouseBill_Click" ImageUrl="/_layouts/emanifest/add.png" ToolTip="Thêm vận đơn gom hàng" Visible="False"  />
                            <asp:GridView runat="server" ID="grdHouseBill" AutoGenerateColumns="False" Width="100%"
                                CssClass="Grid GridStyle" GridLines="Both" AllowPaging="true" PageSize="20" EnableModelValidation="True"
                                OnSelectedIndexChanged="grdHouseBill_SelectedIndexChanged" OnRowCommand="grdHouseBill_RowCommand"
                                DataKeyNames="HouseBillId">
                                <PagerSettings Mode="NumericFirstLast" PageButtonCount="10" FirstPageText="Trang đầu"
                                    LastPageText="Trang cuối" />
                                <RowStyle CssClass="GridItem" />
                                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                <PagerStyle CssClass="GridPager" />
                                <HeaderStyle CssClass="GridHeader" />
                                <AlternatingRowStyle CssClass="GridAlternatingItem" />
                                <Columns>
                                    <asp:CommandField SelectImageUrl="~/_layouts/emanifest/plus.png" ShowSelectButton="true"
                                        ButtonType="Image" SelectText="">
                                        <HeaderStyle HorizontalAlign="Center" />
                                        <ItemStyle HorizontalAlign="Center" />
                                    </asp:CommandField>
                                    <asp:BoundField DataField="BillNumber" HeaderText="Số vận đơn" />
                                    <asp:BoundField DataField="DateOfBill" HeaderText="Ngày vận đơn" ItemStyle-HorizontalAlign="Right"
                                        DataFormatString="{0:dd/MM/yyyy}" />
                                    <asp:BoundField DataField="MasterBillNo" HeaderText="Số master bill" />
                                    <asp:BoundField DataField="DateOfMasterBill" HeaderText="Ngày tạo master bill" ItemStyle-HorizontalAlign="Right"
                                        DataFormatString="{0:dd/MM/yyyy}" />
                                    <asp:BoundField DataField="DepartureDate" HeaderText="Ngày khởi hành" ItemStyle-HorizontalAlign="Right"
                                        DataFormatString="{0:dd/MM/yyyy}" />
                                    <asp:BoundField DataField="Consigner" HeaderText="Người gửi hàng" HtmlEncode="true" />
                                    <asp:BoundField DataField="Consignee" HeaderText="Người nhận hàng" HtmlEncode="true" />
                                    <asp:BoundField DataField="PortNameOfTranship" HeaderText="Cảng chuyển tải/quá cảng"
                                        HtmlEncode="true" />
                                    <asp:BoundField DataField="PortNameOfDestination" HeaderText="Cảng giao hàng/Cảng đích"
                                        HtmlEncode="true" />
                                    <asp:BoundField DataField="PortNameOfLoad" HeaderText="Cảng xếp hàng" HtmlEncode="true" />
                                    <asp:BoundField DataField="PortNameOfUnload" HeaderText="Cảng dỡ hàng " HtmlEncode="true" />
                                    <asp:TemplateField HeaderText="Sửa">
                                        <ItemStyle CssClass="actionlink" Width="30px" VerticalAlign="Middle" />
                                        <ItemTemplate>
                                            <asp:ImageButton ImageUrl="/_layouts/emanifest/edit.png" runat="server" CssClass="edit"
                                                ID="lnkSua" Text="Edit" CommandName="imgedit" CommandArgument='<%#Container.DataItemIndex %>' />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Xóa">
                                        <ItemStyle CssClass="actionlink" Width="30px" VerticalAlign="Middle" />
                                        <ItemTemplate>
                                            <asp:ImageButton ImageUrl="/_layouts/emanifest/remove.png" runat="server" CssClass="remove2"
                                                ID="lnkXoa" Text="Xóa" CommandName="imgremove" CommandArgument='<%#Container.DataItemIndex %>' />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <tr>
                                                <td colspan="100%">
                                                    <div id="div<%# Eval("BillNumber") %>" style="display: block; position: relative;
                                                        left: 15px; overflow: auto; width: 97%">
                                                        <asp:GridView runat="server" ID="grdHouseBillItem" AutoGenerateColumns="False" Width="100%"
                                                            CssClass="Grid GridStyle" GridLines="Both" AllowPaging="true" PageSize="20" EnableModelValidation="True"
                                                            DataKeyNames="HouseBillItemId, HouseBillId" ShowFooter="true"                                                             
                                                            OnRowUpdating="grdHouseBillItem_RowUpdating" OnRowUpdated="grdHouseBillItem_RowUpdated" 
                                                            OnRowEditing="grdHouseBillItem_RowEditing" OnRowCancelingEdit="grdHouseBillItem_CancelingEdit" 
                                                            OnRowDeleting="grdHouseBillItem_RowDeleting" OnRowDeleted="grdHouseBillItem_RowDeleted" 
                                                            OnRowCommand="grdHouseBillItem_RowCommand">
                                                            <PagerSettings Mode="NumericFirstLast" PageButtonCount="10" FirstPageText="Trang đầu"
                                                                LastPageText="Trang cuối" />
                                                            <RowStyle CssClass="GridItem" />
                                                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                                            <PagerStyle CssClass="GridPager" />
                                                            <HeaderStyle CssClass="GridHeader" />
                                                            <AlternatingRowStyle CssClass="GridAlternatingItem" />
                                                            <Columns>                                                          
                                                                <asp:TemplateField HeaderText="Tên hàng/mô tả hàng hóa">
                                                                    <ItemStyle Width="70%" />
                                                                    <ItemTemplate>
                                                                        <%#Eval("Description")%>
                                                                    </ItemTemplate>
                                                                    <EditItemTemplate>
                                                                        <asp:TextBox ID="txtDescription" Text='<%# Eval("Description")%>' runat="server"></asp:TextBox>
                                                                    </EditItemTemplate>
                                                                    <FooterTemplate>
                                                                        <asp:TextBox ID="txtDescription" Text='' runat="server"></asp:TextBox>
                                                                    </FooterTemplate>
                                                                </asp:TemplateField>
                                                                <asp:TemplateField HeaderText="Số hiệu cont">
                                                                    <ItemStyle Width="10%" />
                                                                    <ItemTemplate>
                                                                        <%#Eval("ContNumber")%>
                                                                    </ItemTemplate>
                                                                    <EditItemTemplate>
                                                                        <asp:TextBox ID="txtContNumber" Text='<%# Eval("ContNumber")%>' runat="server"></asp:TextBox>
                                                                        <asp:RequiredFieldValidator ErrorMessage="required" ControlToValidate="txtContNumber" ID="rfvContNumberEdit" runat="server" ValidationGroup="vgHouseBillItemEdit">*</asp:RequiredFieldValidator>
                                                                    </EditItemTemplate>
                                                                    <FooterTemplate>
                                                                        <asp:TextBox ID="txtContNumber" Text='' runat="server"></asp:TextBox>
                                                                        <asp:RequiredFieldValidator ErrorMessage="required" ControlToValidate="txtContNumber" ID="rfvContNumberAdd" runat="server" ValidationGroup="vgHouseBillItemAdd">*</asp:RequiredFieldValidator>
                                                                    </FooterTemplate>
                                                                </asp:TemplateField>
                                                                <asp:TemplateField HeaderText="Số seal cont">
                                                                    <ItemStyle Width="10%" />
                                                                    <ItemTemplate>
                                                                        <%#Eval("ContSealNumber")%>
                                                                    </ItemTemplate>
                                                                    <EditItemTemplate>
                                                                        <asp:TextBox ID="txtContSealNumber" Text='<%# Eval("ContSealNumber")%>' runat="server"></asp:TextBox>
                                                                        <asp:RequiredFieldValidator ErrorMessage="required" ControlToValidate="txtContSealNumber" ID="rfvContSealNumberEdit" runat="server" ValidationGroup="vgHouseBillItemEdit">*</asp:RequiredFieldValidator>
                                                                    </EditItemTemplate>
                                                                    <FooterTemplate>
                                                                        <asp:TextBox ID="txtContSealNumber" Text='' runat="server"></asp:TextBox>
                                                                        <asp:RequiredFieldValidator ErrorMessage="required" ControlToValidate="txtContSealNumber" ID="rfvContSealNumberAdd" runat="server" ValidationGroup="vgHouseBillItemAdd">*</asp:RequiredFieldValidator>
                                                                    </FooterTemplate>
                                                                </asp:TemplateField>
                                                                <asp:TemplateField HeaderText="Tổng trọng lượng">
                                                                    <ItemStyle HorizontalAlign="Right" Width="5%" />
                                                                    <ItemTemplate>
                                                                        <%#Eval("GrossWeight")%>
                                                                    </ItemTemplate>
                                                                    <EditItemTemplate>
                                                                        <asp:TextBox ID="txtGrossWeight" Text='<%# Eval("GrossWeight")%>' runat="server"></asp:TextBox>
                                                                        <asp:RequiredFieldValidator ErrorMessage="required" ControlToValidate="txtGrossWeight" ID="rfvGrossWeightEdit" runat="server" ValidationGroup="vgHouseBillItemEdit">*</asp:RequiredFieldValidator>
                                                                        <asp:RegularExpressionValidator ID="revGrossWeightEdit" runat="server" ControlToValidate="txtGrossWeight"
ErrorMessage="Phải là số" ValidationExpression="^\d+$" ValidationGroup="vgHouseBillItemEdit"></asp:RegularExpressionValidator>
                                                                    </EditItemTemplate>
                                                                    <FooterTemplate>
                                                                        <asp:TextBox ID="txtGrossWeight" Text='' runat="server"></asp:TextBox>
                                                                        <asp:RequiredFieldValidator ErrorMessage="required" ControlToValidate="txtGrossWeight" ID="rfvGrossWeightAdd" runat="server" ValidationGroup="vgHouseBillItemAdd">*</asp:RequiredFieldValidator>
                                                                        <asp:RegularExpressionValidator ID="revGrossWeightAdd" runat="server" ControlToValidate="txtGrossWeight"
ErrorMessage="Phải là số" ValidationExpression="^\d+$" ValidationGroup="vgHouseBillItemAdd"></asp:RegularExpressionValidator>
                                                                    </FooterTemplate>
                                                                </asp:TemplateField>
                                                                <asp:TemplateField HeaderText="Kích thước/thể tích">
                                                                    <ItemStyle HorizontalAlign="Right" Width="5%" />
                                                                    <ItemTemplate>
                                                                        <%#Eval("Demension")%>
                                                                    </ItemTemplate>
                                                                    <EditItemTemplate>
                                                                        <asp:TextBox ID="txtDemension" Text='<%# Eval("Demension")%>' runat="server"></asp:TextBox>
                                                                        <asp:RequiredFieldValidator ErrorMessage="required" ControlToValidate="txtDemension" ID="rfvDemensionEdit" runat="server" ValidationGroup="vgHouseBillItemEdit">*</asp:RequiredFieldValidator>
                                                                        <asp:RegularExpressionValidator ID="revDemensionEdit" runat="server" ControlToValidate="txtDemension"
ErrorMessage="Phải là số" ValidationExpression="^\d+$" ValidationGroup="vgHouseBillItemEdit"></asp:RegularExpressionValidator>
                                                                    </EditItemTemplate>
                                                                    <FooterTemplate>
                                                                        <asp:TextBox ID="txtDemension" Text='' runat="server"></asp:TextBox>
                                                                        <asp:RegularExpressionValidator ID="revDemensionAdd" runat="server" ControlToValidate="txtDemension"
ErrorMessage="Phải là số" ValidationExpression="^\d+$" ValidationGroup="vgHouseBillItemAdd"></asp:RegularExpressionValidator>
                                                                    </FooterTemplate>
                                                                </asp:TemplateField>
                                                               
                                                                <asp:TemplateField HeaderText="" ItemStyle-Wrap="false">
                                                                     <ItemTemplate>
                                                                         <asp:ImageButton ID="lnkEdit" runat="server" CausesValidation="False" 
                                                                             CommandName="Edit" ImageUrl="/_layouts/emanifest/edit.png" Text="Edit" />
                                                                         &nbsp;<asp:ImageButton ID="lnkDelete" runat="server" CausesValidation="False" 
                                                                             CommandName="Delete" ImageUrl="/_layouts/emanifest/remove.png" 
                                                                             Text="Delete item" CssClass="remove2"/>
                                                                     </ItemTemplate>
                                                                     <EditItemTemplate>
                                                                         <asp:ImageButton ID="lnkSave" runat="server" CausesValidation="True" 
                                                                             CommandName="Update" ImageUrl="/_layouts/emanifest/save.png" Text="Update" />
                                                                         &nbsp;<asp:ImageButton ID="lnkCancel" runat="server" CausesValidation="False" 
                                                                             CommandName="Cancel" ImageUrl="/_layouts/emanifest/cancel.png" Text="Cancel" />
                                                                     </EditItemTemplate>
                                                                    <FooterTemplate>
                                                                        <asp:ImageButton ID="lnkInsert" runat="server" Text=""  ValidationGroup="vgHouseBillItemAdd" CommandName="New" ToolTip="Add New Entry" CausesValidation="true"
                                                                            CommandArgument='' ImageUrl="/_layouts/emanifest/add.png"></asp:ImageButton>
                                                                        <asp:ImageButton ID="lnkCancel" runat="server" Text="" CommandName="Cancel" ToolTip="Cancel"  CausesValidation="false"
                                                                            CommandArgument='' ImageUrl="/_layouts/emanifest/cancel.png" ValidationGroup="vgHouseBillItemAdd"></asp:ImageButton>
                                                                    </FooterTemplate>
                                                                </asp:TemplateField>                                                              
                                                            </Columns>
                                                        </asp:GridView>
                                                    </div>
                                                </td>
                                            </tr>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                            <asp:ObjectDataSource ID="odsHouseBill" runat="server" SelectMethod="GetHouseBillPagingByDocumentId"
                                EnablePaging="true" TypeName="EMANIFEST.BusinessObjects.Controllers.DocumentControler"
                                StartRowIndexParameterName="startIndex" MaximumRowsParameterName="pageSize" SelectCountMethod="GetHouseBillNumberByDocumentId"
                                OnSelecting="odsHouseBill_Selecting"></asp:ObjectDataSource>
                            <asp:ObjectDataSource ID="odsHouseBillItem" runat="server" SelectMethod="GetHouseBillItemPagingByHouseBillId"
                                EnablePaging="true" TypeName="EMANIFEST.BusinessObjects.Controllers.DocumentControler"
                                StartRowIndexParameterName="startIndex" MaximumRowsParameterName="pageSize" SelectCountMethod="GetHouseBillItemNumberByHouseBillId"
                                OnSelecting="odsHouseBillItem_Selecting">
                                <SelectParameters>
                                    <asp:Parameter Name="houseBillId" Type="String" DefaultValue="" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                            <asp:Button CssClass="button" ID="btnShowPopupHouseBill" runat="server" Style="display: none" />
                            <asp:ModalPopupExtender ID="popupHouseBill" runat="server" TargetControlID="btnShowPopupHouseBill"
                                PopupControlID="pnlAddHouseBill" BackgroundCssClass="modalBackground" DropShadow="false">
                            </asp:ModalPopupExtender>
                            <div>
                                <asp:Panel ID="pnlAddHouseBill" runat="server" CssClass="popup" Style="display: none">
                                    <div class="two-columns">
                                        <fieldset>
                                            <legend>
                                                <asp:Label ID="Label1" runat="server" Text="Thông tin vận đơn gom hàng" />
                                            </legend>
                                            <div class="left-column">
                                                <p>
                                                    <asp:Label ID="lblBillNumber" runat="server" AssociatedControlID="txtBillNumber"
                                                        Text="Vận đơn số" CssClass="label required" />
                                                        <label class="label_english">(Bill of lading number)</label>
                                                </p>
                                                <asp:TextBox runat="server" ID="txtBillNumber" CssClass="w200  validate[required] text-input"></asp:TextBox>
                                                <p>
                                                    <asp:Label ID="lblDateOfBill" runat="server" AssociatedControlID="txtDateOfBill"
                                                        Text="Ngày vận đơn" CssClass="label required" />
                                                        <label class="label_english">(Date of bill of lading)</label>
                                                </p>
                                                <asp:TextBox CssClass="w100 validate[required] text-input" ID="txtDateOfBill" runat="server" />
                                                <asp:CalendarExtender ID="cDateOfBill" runat="server" TargetControlID="txtDateOfBill"
                                                    Format="dd/MM/yyyy" OnClientShown="calendarShown" PopupButtonID="imgDateOfBill">                                                                                                        
                                                </asp:CalendarExtender>
                                                <asp:Image ID="imgDateOfBill" runat="server" ImageUrl="~/_layouts/emanifest/calendar.png" />
                                                <p>
                                                    <asp:Label ID="lblMasterBillNo" runat="server" AssociatedControlID="txtMasterBillNo"
                                                        Text="Số master bill" CssClass="label required" />
                                                        <label class="label_english">(Bill of lading number)</label>
                                                        </p>
                                                <asp:TextBox runat="server" ID="txtMasterBillNo" CssClass="w200 validate[required] text-input"></asp:TextBox>
                                                <p>
                                                    <asp:Label ID="lblDateOfMasterBill" runat="server" AssociatedControlID="txtDateOfMasterBill"
                                                        Text="Ngày tạo master bill" CssClass="label required" />
                                                        <label class="label_english">(Create date master bill)</label>
                                                </p>
                                                <asp:TextBox CssClass="w100 validate[required] text-input" ID="txtDateOfMasterBill"
                                                    runat="server" />
                                                <asp:CalendarExtender ID="cDateOfMasterBill" runat="server" TargetControlID="txtDateOfMasterBill"
                                                    Format="dd/MM/yyyy"  OnClientShown="calendarShown" PopupButtonID="imgDateOfMasterBill">        
                            </asp:CalendarExtender>                        
                            <asp:Image ID="imgDateOfMasterBill" runat="server" ImageUrl="~/_layouts/emanifest/calendar.png" />
                                                <p>
                                                    <asp:Label ID="lblConsigner" runat="server" AssociatedControlID="txtConsigner" Text="Người gửi"
                                                        CssClass="label required" />
                                                        <label class="label_english">(Consigner)</label>
                                                        </p>
                                                <asp:TextBox CssClass="validate[required]" ID="txtConsigner" runat="server" TextMode="MultiLine"
                                                    Rows="2" />
                                                <p>
                                                    <asp:Label ID="lblConsignee" runat="server" AssociatedControlID="txtConsignee" Text="Người nhận"
                                                        CssClass="label required" />
                                                        <label class="label_english">(Consignee)</label>
                                                        </p>
                                                <asp:TextBox CssClass="validate[required]" ID="txtConsignee" runat="server" TextMode="MultiLine"
                                                    Rows="2" />
                                            </div>
                                            <div class="right-column">
                                                <p>
                                                    <asp:Label ID="lblDateOfDeparture" runat="server" AssociatedControlID="txtDateOfDeparture"
                                                        Text="Ngày khởi hành" CssClass="label required" />
                                                        <label class="label_english">(Departure date)</label>
                                                </p>
                                                <asp:TextBox CssClass="w100 validate[required] text-input" ID="txtDateOfDeparture"
                                                    runat="server" />
                                                <asp:CalendarExtender ID="cDateOfDeparture" runat="server" TargetControlID="txtDateOfDeparture"
                                                    Format="dd/MM/yyyy"  OnClientShown="calendarShown" PopupButtonID="imgDateOfDeparture">        
                            </asp:CalendarExtender>                        
                            <asp:Image ID="imgDateOfDeparture" runat="server" ImageUrl="~/_layouts/emanifest/calendar.png" />
                                                <p>
                                                    <asp:Label ID="lblHouseBillPortOfDestination" runat="server" AssociatedControlID="txtHouseBillPortOfDestination"
                                                        Text="Cảng giao hàng/cảng đích" CssClass="label required" />
                                                        <label class="label_english">(Port of destination)</label>
                                                        </p>
                                                <asp:TextBox runat="server" ID="txtHouseBillPortOfDestination" CssClass="w200  validate[required] text-input"></asp:TextBox>
                                                <p>
                                                    <asp:Label ID="lblHouseBillPortOfTranship" runat="server" AssociatedControlID="txtHouseBillPortOfTranship"
                                                        Text="Cảng chuyển tải/quá cảng" CssClass="label required" />
                                                        <label class="label_english">(Port of tranship/transit)</label>
                                                        </p>
                                                <asp:TextBox runat="server" ID="txtHouseBillPortOfTranship" CssClass="w200  validate[required] text-input"></asp:TextBox>
                                                <p>
                                                    <asp:Label ID="lblHouseBillPortOfLoad" runat="server" AssociatedControlID="txtHouseBillPortOfLoad"
                                                        Text="Cảng xếp hàng" CssClass="label required" />
                                                        <label class="label_english">(Port of load)</label>
                                                        </p>
                                                <asp:TextBox runat="server" ID="txtHouseBillPortOfLoad" CssClass="w200  validate[required] text-input"></asp:TextBox>
                                                <p>
                                                    <asp:Label ID="lblHouseBillPortOfUnload" runat="server" AssociatedControlID="txtHouseBillPortOfUnload"
                                                        Text="Cảng dỡ hàng" CssClass="label required" />
                                                        <label class="label_english">(Port of unload)</label>
                                                        </p>
                                                <asp:TextBox runat="server" ID="txtHouseBillPortOfUnload" CssClass="w200  validate[required] text-input"></asp:TextBox>
                                            </div>
                                        </fieldset>
                                        <fieldset>
                                            <asp:TextBox runat="server" ID="txtHouseBillId" ReadOnly="true" Visible="false" />
                                            <asp:Label runat="server" ID="lblHouseBillError" Text=""></asp:Label>
                                            <br />
                                            <asp:Button CssClass="button submit" ID="btnUpdateHouseBill" CommandName="Update"
                                                runat="server" Text="Cập nhật" OnClick="btnUpdateHouseBill_Click" />
                                            <asp:Button CssClass="button" ID="Button1" runat="server" Text="Bỏ qua" OnClientClick="btnCancel_OnClientClick(); return false;" />
                                        </fieldset>
                                    </div>
                                </asp:Panel>
                            </div>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </ContentTemplate>
            </asp:TabPanel>


            <asp:TabPanel ID="TabPanel2" runat="server" HeaderText="Bản khai chung" ToolTip="General Declaration">
                <ContentTemplate>
                <div>
                        <uc1:UploadFile ID="upFileGeneralDecralation" runat="server" />
                    </div>
                    <asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpdatePanel3">
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btnGeneralDeclarationTrigger" />                        
                            <asp:AsyncPostBackTrigger ControlID="btnUpdateGeneralDecralation" />
                        </Triggers>
                        <ContentTemplate>
                            <asp:Label runat="server" ID="lblGeneralDecralationTabLoadStatus" Text="Loading..."></asp:Label>
                            <label class="label_vietnam">Bản khai chung: </label> <br /><label class="label_english">(General Declaration)</label>
                            <div>
                                <asp:ImageButton ID="lnkAddGeneralDecralation" runat="server" Text="Add" OnClientClick="lnkGeneralDecralation_OnClientClick(); return false;"
                                    ImageUrl="/_layouts/emanifest/add.png" ToolTip="Thêm bản khai chung" />
                                <asp:ImageButton ID="lnkEditGeneralDecralation" runat="server" Text="Edit" OnClientClick="lnkGeneralDecralation_OnClientClick(); return false;"
                                    ImageUrl="/_layouts/emanifest/edit.png" ToolTip="Sửa bản khai chung" CssClass="edit" />
                            </div>

                            <div class="wrapper">
                                <div class="left">
                                        <asp:Label ID="Label6" runat="server" Text="Cảng rời/cảng đích" CssClass="label_vietnam"/><br />
                                        <label class="label_english">(Last port call/next port of call)</label><br />
                                        <asp:Label ID="Label7" runat="server" Text="Tên và địa chỉ liên lạc của đại lý" CssClass="label_vietnam" /><br />
                                        <label class="label_english">(Name and contact details of the ship agent)</label><br />
                                        <asp:Label ID="Label9" runat="server" Text="Đặc điểm chính của chuyến đi (các cảng trước)." CssClass="label_vietnam" /><br />
                                        <label class="label_english">(Brief particulars of voyage ())</label><br />
                                        <asp:Label ID="Label11" runat="server" Text="Đặc điểm chính của chuyến đi (các cảng sẽ đến)" CssClass="label_vietnam" /><br />
                                        <label class="label_english">(Brief particulars of voyage ())</label><br />
                                        <asp:Label ID="Label13" runat="server" Text="Đặc điểm chính của chuyến đi (các cảng sẽ dỡ hàng)" CssClass="label_vietnam" /><br />
                                        <label class="label_english">(Brief particulars of voyage ())</label><br />
                                        <asp:Label ID="Label15" runat="server" Text="Vị trí tàu tại cảng" CssClass="label_vietnam" /><br />
                                        <label class="label_english">(Position of the ship in the port (berth or station))</label><br />
                                        <asp:Label ID="Label17" runat="server" Text="Mô tả tóm tắt về hàng hóa" CssClass="label_vietnam" /><br />
                                        <label class="label_english">(Brief description of the cargo)</label><br />
                                       <asp:Label ID="Label8" runat="server" Text="Số thuyền viên" CssClass="label_vietnam" /><br />
                                        <label class="label_english">(Number of crew)</label><br />
                                         <asp:Label ID="Label12" runat="server" Text="Số hành khách" CssClass="label_vietnam" /><br />
                                        <label class="label_english">(Number of passenger)</label><br />
                                        <asp:Label ID="Label10" runat="server" Text="Ghi chú" CssClass="label_vietnam" /><br />
                                        <label class="label_english">(Remarks)</label><br />
                                        <asp:Label ID="Label14" runat="server" Text="Yêu cầu về phương tiện tiếp nhận và xử lý chất thải" CssClass="label_vietnam" />
                                        <br /><label class="label_english">(The ship's requirements in terms of waste and residue reception facilities)</label>
                                </div>
                                <div class="left">
                                    <asp:Label runat="server" ID="lblDeparturePort0"></asp:Label><br /><br />
                                    <asp:Label runat="server" ID="lblContactDetails0"></asp:Label><br /><br />
                                    <asp:Label runat="server" ID="lblPreviousPorts0"></asp:Label><br /><br />
                                    <asp:Label runat="server" ID="lblSubsequentPorts0"></asp:Label><br /><br />
                                    <asp:Label runat="server" ID="lblParticularsOfVoyage0"></asp:Label><br /><br />
                                    <asp:Label runat="server" ID="lblPosition0"></asp:Label><br /><br />
                                    <asp:Label runat="server" ID="lblDesProduct0"></asp:Label><br /><br />
                                    <asp:Label runat="server" ID="lblNumberCrews0"></asp:Label><br /><br />
                                    <asp:Label runat="server" ID="lblNumberCustomer0"></asp:Label><br /><br />
                                    <asp:Label runat="server" ID="lblNode0"></asp:Label><br /><br />
                                    <asp:Label runat="server" ID="lblRequire0"></asp:Label><br /><br />
                                </div>
                            </div>

                            <asp:Panel ID="pnlGeneralDecralation" runat="server" CssClass="popup" Style="display: none">
                                <div class="two-column">
                                    <fieldset>
                                        <legend>
                                            <asp:Label ID="Label16" runat="server" Text="Thông tin bản khai chung" />
                                        </legend>
                                        <div class="left-column">
                                            <p>
                                                <asp:Label ID="lblDeparturePort" runat="server" AssociatedControlID="ddlDeparturePort"
                                                    Text="Cảng rời/cảng đích " CssClass="label required" />
                                                    <label class="label_english">(Port of arrival/departure)</label>
                                            </p>
                                            <asp:DropDownList runat="server" ID="ddlDeparturePort" CssClass="validate[required]" DataValueField = "PortId" DataTextField = "Name"></asp:DropDownList>
                                            <p>
                                                <asp:Label ID="lblContactDetails" runat="server" AssociatedControlID="txtContactDetails"
                                                    Text="Tên và địa chỉ liên lạc của đại lý " CssClass="label required" />
                                                    <label class="label_english">(Name and contact details of the ship agent)</label>
                                           </p>
                                            <asp:TextBox runat="server" ID="txtContactDetails" CssClass="validate[required] text-input"
                                                TextMode="MultiLine" Rows="3"></asp:TextBox>
                                            <p>
                                                <asp:Label ID="lblPreviousPorts" runat="server" AssociatedControlID="txtPreviousPort"
                                                    Text="Đặc điểm chính của chuyến đi (các cảng trước) " CssClass="label required" />
                                                     <label class="label_english">(Brief particulars of voyage (previous))</label>
                                                    </p>
                                            <asp:TextBox runat="server" ID="txtPreviousPort" CssClass="validate[required] text-input" TextMode="MultiLine" Rows="3"></asp:TextBox>
                                            <p>
                                                <asp:Label ID="lblSubsequentPorts" runat="server" AssociatedControlID="txtSubsequentPorts"
                                                    Text="Đặc điểm chính của chuyến đi (các cảng sẽ đến) " CssClass="label required" />
                                                    <label class="label_english">(Brief particulars of voyage (subsequent port of call))</label>
                                                    </p>
                                            <asp:TextBox runat="server" ID="txtSubsequentPorts" CssClass="validate[required] text-input"
                                                TextMode="MultiLine" Rows="3"></asp:TextBox>
                                            <p>
                                                <asp:Label ID="lblParticularsOfVoyage" runat="server" AssociatedControlID="txtParticularsOfVoyage"
                                                    Text="Đặc điểm chính của chuyến đi (các cảng sẽ dỡ hàng) " CssClass="label required" />
                                                    <label class="label_english">(Brief particulars of voyage (underline where remaining cargo will be discharged))</label>
                                            </p>
                                            <asp:TextBox runat="server" ID="txtParticularsOfVoyage" CssClass="validate[required] text-input"
                                                TextMode="MultiLine" Rows="3"></asp:TextBox>
                                        </div>
                                        <div class="right-column">

                                            <p>
                                                <asp:Label ID="lblPosition" runat="server" AssociatedControlID="txtGDPosition" Text="Vị trí tàu tại cảng "
                                                    CssClass="label required" />
                                                <label class="label_english">(Position of the ship in the port (berth or station))</label>
                                            </p>
                                            <asp:TextBox runat="server" ID="txtGDPosition" CssClass="validate[required] text-input"
                                                TextMode="MultiLine" Rows="2"></asp:TextBox>
                                            <p>
                                                <asp:Label ID="lblDesProduct" runat="server" AssociatedControlID="txtDesProduct"
                                                    Text="Mô tả tóm tắt về hàng hóa" CssClass="label required" />
                                                <label class="label_english">(Brief description of the cargo)</label>
                                                    </p>
                                            <asp:TextBox runat="server" ID="txtDesProduct" CssClass="validate[required] text-input"
                                                TextMode="MultiLine" Rows="5"></asp:TextBox>
                                            <div style="float: left; width:50%"">
                                                <p>
                                                    <asp:Label ID="lblNumberCrews" runat="server" AssociatedControlID="txtNumberCrews"
                                                        Text="Số thuyền viên" CssClass="label required" />
                                                        <label class="label_english">(Number of crew)</label>
                                                        </p>
                                                <asp:TextBox runat="server" ID="txtNumberCrews" CssClass="w100 validate[required] text-input"></asp:TextBox>
                                            </div>
                                            <div style="float: left; width:50%"">
                                                <p>
                                                    <asp:Label ID="lblNumberCustomer" runat="server" AssociatedControlID="txtNumberCustomer"
                                                        Text="Số hành khách" CssClass="label required" />
                                                    <label class="label_english">(Number of passenger)</label>
                                                </p>
                                                <asp:TextBox runat="server" ID="txtNumberCustomer" CssClass="w100 validate[required] text-input"></asp:TextBox>
                                            </div>
                                            <p>
                                                <asp:Label ID="lblNode" runat="server" AssociatedControlID="txtNode" Text="Ghi chú"
                                                    CssClass="label required" />
                                                     <label class="label_english">(Remarks)</label>
                                                    </p>
                                            <asp:TextBox runat="server" ID="txtNode" CssClass="validate[required] text-input"
                                                TextMode="MultiLine" Rows="5"></asp:TextBox>
                                            <p>
                                                <asp:Label ID="lblRequire" runat="server" AssociatedControlID="txtRequire" Text="Yêu cầu về phương tiện tiếp nhận và xử lý chất thải"
                                                    CssClass="label required" />
                                                <label class="label_english">(The ship's requirements in terms of waste and residue reception facilities)</label>
                                            </p>
                                            <asp:TextBox runat="server" ID="txtRequire" CssClass="validate[required] text-input"
                                                TextMode="MultiLine" Rows="3"></asp:TextBox>
                                        </div>
                                    </fieldset>
                                    <fieldset>
                                        <asp:Label runat="server" ID="lblGeneralDecralationError"></asp:Label>
                                        <asp:TextBox runat="server" ID="txtGeneralDeclarationId" ReadOnly="true" Visible="false" />
                                        <br />
                                        <asp:Button CssClass="button submit" ID="btnUpdateGeneralDecralation" CommandName="Update"
                                            runat="server" Text="Cập nhật" OnClick="btnUpdateGeneralDecralation_Click" CausesValidation="true" />
                                        <asp:Button CssClass="button" ID="btnGeneralDecralationCancel" runat="server" Text="Bỏ qua"
                                            OnClientClick="btnCancel_OnClientClick(); return false;" />
                                    </fieldset>
                                </div>
                            </asp:Panel>
                            <asp:Button CssClass="button" ID="btnShowPopupGeneralDecralation" runat="server"
                                Style="display: none" />
                            <asp:ModalPopupExtender ID="popupGeneralDecralation" BehaviorID="popupGeneralDecralation"
                                runat="server" TargetControlID="btnShowPopupGeneralDecralation" PopupControlID="pnlGeneralDecralation"
                                BackgroundCssClass="modalBackground" DropShadow="false">
                            </asp:ModalPopupExtender>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </ContentTemplate>
            </asp:TabPanel>


            <asp:TabPanel ID="TabPanel3" runat="server" HeaderText="Danh sách thuyền viên" ToolTip="Crew list">
                <ContentTemplate>
                    <div>
                        <uc1:UploadFile ID="upFileCrew" runat="server" />
                    </div>
                    <asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpdatePanel4">
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btnCrewsTrigger" />
                            <asp:AsyncPostBackTrigger ControlID="grdCrews" />
                            <asp:AsyncPostBackTrigger ControlID="btnUpdateCrew" />
                        </Triggers>
                        <ContentTemplate>
                            <asp:Label runat="server" ID="lblCrewTabLoadStatus" Text="Loading..."></asp:Label>
                            <label class="label_vietnam">Danh sách thuyền viên:</label>
                            <asp:ImageButton ID="imbAddCreww" runat="server" Text="Add" OnClick="lnkAddCrew_Click"
                                ImageUrl="/_layouts/emanifest/add.png" ToolTip="Thêm thuyền viên" />
                                <br /><label class="label_english">(Crew list)</label>
                            <asp:GridView runat="server" ID="grdCrews" AutoGenerateColumns="false" Width="100%"
                                GridLines="Both" CssClass="GridStyle" AllowPaging="true" PageSize="20" DataKeyNames="CrewId, StateId,PassportType"
                                OnRowCommand="grdCrews_RowCommand">
                                <RowStyle CssClass="GridItem" />
                                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                <PagerStyle CssClass="GridPager" />
                                <HeaderStyle CssClass="GridHeader" />
                                <AlternatingRowStyle CssClass="GridAlternatingItem" />
                                <Columns>
                                    <asp:BoundField DataField="FamilyName" HeaderText="Họ" HtmlEncode="true" />
                                    <asp:BoundField DataField="GivenName" HeaderText="Tên" HtmlEncode="true" />
                                    <asp:BoundField DataField="Rank" HeaderText="Chức vụ" HtmlEncode="true" />
                                    <asp:BoundField DataField="BirthDate" HeaderText="Ngày sinh" HtmlEncode="true" ItemStyle-HorizontalAlign="Right"
                                        DataFormatString="{0:dd/MM/yyyy}" />
                                    <asp:BoundField DataField="BirthPlace" HeaderText="Nơi sinh" HtmlEncode="true" />
                                    <asp:BoundField DataField="StateId" Visible="false" />
                                    <asp:TemplateField HeaderText="Quốc tịnh">
                                        <ItemTemplate>
                                            <%#Eval("State.Name")%>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="PassportType" Visible="false" />
                                    <asp:TemplateField HeaderText="Loại hộ chiếu">
                                        <ItemTemplate>
                                            <%#Eval("PassportTypeDto.Description")%>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="PassportNumber" HeaderText="Số hộ chiếu" HtmlEncode="true"
                                        ItemStyle-HorizontalAlign="Right" />
                                    <asp:BoundField DataField="PassportValidDate" HeaderText="Ngày hết hạn" HtmlEncode="true"
                                        ItemStyle-HorizontalAlign="Right" DataFormatString="{0:dd/MM/yyyy}" />
                                    <asp:TemplateField HeaderText="Sửa">
                                        <ItemStyle CssClass="actionlink" Width="30px" VerticalAlign="Middle" />
                                        <ItemTemplate>
                                            <asp:ImageButton ImageUrl="/_layouts/emanifest/edit.png" runat="server" CssClass="edit"
                                                ID="lnkSua" Text="Sửa" CommandName="imgedit" CommandArgument='<%#Container.DataItemIndex %>' />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Xóa">
                                        <ItemStyle CssClass="actionlink" Width="30px" VerticalAlign="Middle" />
                                        <ItemTemplate>
                                            <asp:ImageButton ImageUrl="/_layouts/emanifest/remove.png" runat="server" CssClass="remove2"
                                                ID="lnkXoa" Text="Xóa" CommandName="imgremove" CommandArgument='<%#Container.DataItemIndex %>' />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                            <asp:ObjectDataSource ID="odsCrews" runat="server" SelectMethod="GetCrewPagingByDocumentId"
                                EnablePaging="true" TypeName="EMANIFEST.BusinessObjects.Controllers.DocumentControler"
                                StartRowIndexParameterName="startIndex" MaximumRowsParameterName="pageSize" SelectCountMethod="GetCrewNumberByDocumentId"
                                OnSelecting="odsCrews_Selecting"></asp:ObjectDataSource>
                            <asp:Button CssClass="button" ID="btnShowPopupCrew" runat="server" Style="display: none" />
                            <asp:ModalPopupExtender ID="popupCrew" runat="server" TargetControlID="btnShowPopupCrew"
                                PopupControlID="pnlAddCrew" BackgroundCssClass="modalBackground" DropShadow="false">
                            </asp:ModalPopupExtender>


                            <div>
                                <asp:Panel ID="pnlAddCrew" runat="server" CssClass="popup" Style="display: none">
                                    <div class="two-columns">
                                        <fieldset>
                                            <legend>
                                                <asp:Label ID="lblLegend" runat="server" Text="Thông tin về thuyền viên" />
                                            </legend>
                                            <div class="left-column">
                                                <p>
                                                    <asp:Label ID="lblHo" runat="server" AssociatedControlID="txtHo" Text="Họ" CssClass="label required" />
                                                    <label class="label_english">(Family name)</label>
                                                </p>
                                                <asp:TextBox runat="server" ID="txtHo" CssClass="w200  validate[required] text-input"
                                                    onchange="TextChange(this.id, this.value)"></asp:TextBox>
                                                <asp:FilteredTextBoxExtender ID="ftbeHo" runat="server" TargetControlID="txtHo" InvalidChars=",.?"
                                                    FilterMode="InvalidChars" />
                                                <p>
                                                    <asp:Label ID="lblTen" runat="server" AssociatedControlID="txtTen" Text="Tên" CssClass="label required" />
                                                    <label class="label_english">(Given name)</label>
                                                    </p>
                                                <asp:TextBox runat="server" ID="txtTen" CssClass="w200 validate[required] text-input"
                                                    onchange="TextChange(this.id, this.value)"></asp:TextBox>
                                                <p>
                                                    <asp:Label ID="lblNgaySinh" AssociatedControlID="txtNgaySinh" runat="server" Text="Ngày sinh:" CssClass="label required" />
                                                    <label class="label_english">(Date of birth)</label>
                                                </p>
                                                <asp:TextBox runat="server" ID="txtNgaySinh" CssClass="w100 validate[required] text-input"></asp:TextBox>
                                                <asp:CalendarExtender ID="cNgaySinh" runat="server" TargetControlID="txtNgaySinh"
                                                    BehaviorID="cNgaySinhID" Format="dd/MM/yyyy"  OnClientShown="calendarShown" PopupButtonID="imgNgaySinh">        
                            </asp:CalendarExtender>                        
                            <asp:Image ID="imgNgaySinh" runat="server" ImageUrl="~/_layouts/emanifest/calendar.png" />
                                                <p>
                                                    <asp:Label ID="lblNoiSinh" runat="server" AssociatedControlID="txtNoiSinh" Text="Nơi sinh:"
                                                        CssClass="label required" />
                                                        <label class="label_english">(Place of date)</label>
                                                </p>
                                                <asp:TextBox runat="server" ID="txtNoiSinh" CssClass="w200 validate[required]" onchange="TextChange(this.id, this.value)"></asp:TextBox>
                                            </div>
                                            <div class="right-column">
                                                <p>
                                                    <asp:Label ID="lblChucDanh" runat="server" AssociatedControlID="txtChucDanh" Text="Chức danh"
                                                        CssClass="label required" />
                                                        <label class="label_english">(Rank or rating)</label>
                                                        </p>
                                                <asp:TextBox runat="server" ID="txtChucDanh" CssClass="w200 validate[required] text-input"
                                                    onchange="TextChange(this.id, this.value)"></asp:TextBox>
                                                <p>
                                                    <asp:Label ID="lblQuocTich" runat="server" AssociatedControlID="ddlQuocTich" Text="Quốc tịch"
                                                        CssClass="label required" />
                                                    <label class="label_english">(Nationality)</label>
                                                </p>
                                                <asp:DropDownList runat="server" ID="ddlQuocTich" CssClass="w200 validate[required]"
                                                    DataTextField="Name" DataValueField="StateId">
                                                </asp:DropDownList>
                                                <p>
                                                    <asp:Label ID="lblLoaiHoChieu" runat="server" AssociatedControlID="ddlLoaiHoChieu"
                                                        Text="Loại hộ chiếu:" CssClass="label required" />
                                                        <label class="label_english">(Type of identity document)</label>
                                                </p>
                                                <asp:DropDownList runat="server" ID="ddlLoaiHoChieu" CssClass="w200 validate[required]"
                                                    DataTextField="Description" DataValueField="PassportType">
                                                </asp:DropDownList>
                                                <p>
                                                    <asp:Label ID="lblSoHoChieu" runat="server" AssociatedControlID="txtSoHoChieu" Text="Số hộ chiếu"
                                                        CssClass="label required" />
                                                        <label class="label_english">(Serial number of identity document)</label>
                                                        </p>
                                                <asp:TextBox runat="server" ID="txtSoHoChieu" CssClass="w200 validate[required]"
                                                    onchange="TextChange(this.id, this.value)"></asp:TextBox>
                                                <p>
                                                    <asp:Label ID="lblNgayHetHan" AssociatedControlID="txtNgayHetHan" runat="server" Text="Ngày hết hạn hộ chiếu" CssClass="label required" />
                                                    <label class="label_english">(Expires)</label>
                                                    </p>
                                                <asp:TextBox runat="server" ID="txtNgayHetHan" CssClass="w100 validate[required] text-input"></asp:TextBox>
                                                <asp:CalendarExtender ID="cNgayHetHan" runat="server" TargetControlID="txtNgayHetHan"
                                                    BehaviorID="cNgayHetHanID" Format="dd/MM/yyyy"  OnClientShown="calendarShown" PopupButtonID="imgNgayHetHan">        
                            </asp:CalendarExtender>                        
                            <asp:Image ID="imgNgayHetHan" runat="server" ImageUrl="~/_layouts/emanifest/calendar.png" />
                                            </div>
                                        </fieldset>
                                        <fieldset>
                                            <asp:TextBox runat="server" ID="txtCrewId" ReadOnly="true" Visible="false" />
                                            <asp:HiddenField ID="txtHoRO" runat="server" />
                                            <asp:TextBox runat="server" ID="txtTenRO" ReadOnly="true" Style="display: none;"></asp:TextBox>
                                            <asp:TextBox runat="server" ID="txtChucDanhRO" Style="display: none;"></asp:TextBox>
                                            <asp:TextBox runat="server" ID="txtNoiSinhRO" Style="display: none;"></asp:TextBox>
                                            <asp:TextBox runat="server" ID="txtSoHoChieuRO" Style="display: none;"></asp:TextBox>
                                            <asp:Label runat="server" ID="lblCrewError"></asp:Label>
                                            <br />
                                            <asp:Button CssClass="button submit" ID="btnUpdateCrew" CommandName="Update" runat="server"
                                                Text="Cập nhật" OnClick="btnUpdateCrew_Click" />
                                            <asp:Button CssClass="button" ID="btnCrewCancel" runat="server" Text="Bỏ qua" OnClientClick="btnCancel_OnClientClick(); return false;" />
                                        </fieldset>
                                    </div>
                                </asp:Panel>
                            </div>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </ContentTemplate>
            </asp:TabPanel>

            <asp:TabPanel ID="TabPanel4" runat="server" HeaderText="BK hành lý thuyền viên" ToolTip="Crew's effects declaration">
                <ContentTemplate>
                    <div>
                        <uc1:UploadFile ID="upFileCrewEffect" runat="server" />
                    </div>
                    <asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpdatePanel8">
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btnCrewEffectTrigger" />
                            <asp:AsyncPostBackTrigger ControlID="grdCrewEffect" />
                            <asp:AsyncPostBackTrigger ControlID="btnUpdateCrewEffect" />
                        </Triggers>
                        <ContentTemplate>
                            <asp:Label runat="server" ID="lblCrewEffectTabLoadStatus" Text="Loading..."></asp:Label>
                           <label class="label_vietnam"> Bản khai hành lý thuyền viên:</label>
                            <asp:ImageButton ID="lnkAddCrewEffect" runat="server" Text="Add" OnClick="lnkAddCrewEffect_Click"
                                ImageUrl="/_layouts/emanifest/add.png" ToolTip="Thêm hành lý thuyền viên" /><br /><label class="label_english">(Crew's Effects Declaration)</label>
                            <asp:GridView runat="server" ID="grdCrewEffect" AutoGenerateColumns="false" Width="100%"
                                GridLines="Both" CssClass="GridStyle" AllowPaging="true" PageSize="20" DataKeyNames="CrewEffectDeclarationId"
                                OnRowCommand="grdCrewEffect_RowCommand">
                                <RowStyle CssClass="GridItem" />
                                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                <PagerStyle CssClass="GridPager" />
                                <HeaderStyle CssClass="GridHeader" />
                                <AlternatingRowStyle CssClass="GridAlternatingItem" />
                                <Columns>                                    
                                    <asp:BoundField DataField="FullName" HeaderText="Họ & Tên" HtmlEncode="true" ItemStyle-Width="25%" />
                                    <asp:BoundField DataField="Rank" HeaderText="Chức vụ" HtmlEncode="true" ItemStyle-Width="15%" />
                                    <asp:BoundField DataField="DutyPackage" HeaderText="Hành lý nộp thuế" HtmlEncode="true"
                                        ItemStyle-Width="60%" />
                                    <asp:TemplateField HeaderText="Sửa">
                                        <ItemStyle CssClass="actionlink" Width="30px" VerticalAlign="Middle" />
                                        <ItemTemplate>
                                            <asp:ImageButton ImageUrl="/_layouts/emanifest/edit.png" runat="server" CssClass="edit"
                                                ID="lnkSua" Text="Edit" CommandName="imgedit" CommandArgument='<%#Container.DataItemIndex %>' />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Xóa">
                                        <ItemStyle CssClass="actionlink" Width="30px" VerticalAlign="Middle" />
                                        <ItemTemplate>
                                            <asp:ImageButton ImageUrl="/_layouts/emanifest/remove.png" runat="server" CssClass="remove2"
                                                ID="lnkXoa" Text="Xóa" CommandName="imgremove" CommandArgument='<%#Container.DataItemIndex %>' />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                            <asp:ObjectDataSource ID="odsCrewEffect" runat="server" SelectMethod="GetCrewEffectPagingByDocumentId"
                                EnablePaging="true" TypeName="EMANIFEST.BusinessObjects.Controllers.DocumentControler"
                                StartRowIndexParameterName="startIndex" MaximumRowsParameterName="pageSize" SelectCountMethod="GetCrewEffectNumberByDocumentId"
                                OnSelecting="odsCrewEffect_Selecting"></asp:ObjectDataSource>

                            <asp:Panel ID="pnlAddCrewEffect" runat="server" CssClass="popup" Style="display: none">
                                <div class="one-column">
                                    <fieldset>
                                        <legend>
                                            <asp:Label ID="Label2" runat="server" Text="Thông tin về hành lý thuyền viên" />
                                        </legend>
                                            <p>
                                                <asp:Label ID="lblHoTen" runat="server" AssociatedControlID="txtHoTen" Text="Họ và tên"
                                                    CssClass="label required" />
                                                    <label class="label_english">(Family name, give name)</label>
                                            </p>
                                            <asp:TextBox runat="server" ID="txtHoTen" CssClass="w200  validate[required] text-input"></asp:TextBox>                                            
                                            <p>
                                                <asp:Label ID="lblChucDanh2" runat="server" AssociatedControlID="txtChucDanh2" Text="Chức danh"
                                                    CssClass="label required" />
                                                    <label class="label_english">(Rank or rating)</label>
                                                    </p>
                                            <asp:TextBox runat="server" ID="txtChucDanh2" CssClass="w200 validate[required] text-input"></asp:TextBox>
                                            <p>
                                                <asp:Label ID="lblHanhLy" runat="server" AssociatedControlID="txtHanhLy" Text="Hành lý nộp thuế"
                                                    CssClass="label required" />
                                                    <label class="label_english">(Duty package )</label>
                                            </p>
                                            <asp:TextBox runat="server" ID="txtHanhLy" CssClass="validate[required] text-input" TextMode="MultiLine" Rows="4"></asp:TextBox>
                                    </fieldset>
                                    <fieldset>
                                        <asp:TextBox runat="server" ID="txtCrewEffectId" Visible="false" />
                                        <asp:Label runat="server" ID="lblCrewEffectError"></asp:Label>
                                        <br />
                                        <asp:Button CssClass="button submit" ID="btnUpdateCrewEffect" CommandName="Update"
                                            runat="server" Text="Cập nhật" OnClick="btnUpdateCrewEffect_Click" CausesValidation="true" />
                                        <asp:Button CssClass="button" ID="btnCrewEffectCancel" runat="server" Text="Bỏ qua"
                                            OnClientClick="btnCancel_OnClientClick(); return false;" />
                                    </fieldset>
                                </div>
                            </asp:Panel>
                            <asp:Button CssClass="button" ID="btnShowPopupCrewEffect" runat="server" Style="display: none" />
                            <asp:ModalPopupExtender ID="popupCrewEffect" runat="server" TargetControlID="btnShowPopupCrewEffect"
                                PopupControlID="pnlAddCrewEffect" BackgroundCssClass="modalBackground" DropShadow="false">
                            </asp:ModalPopupExtender>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </ContentTemplate>
            </asp:TabPanel>


            <asp:TabPanel ID="TabPanel5" runat="server" HeaderText="BK dự trữ của tàu" ToolTip="Ship's store declaration">
                <ContentTemplate>
                    <div>
                        <uc1:UploadFile ID="upFileShipStore" runat="server" />
                    </div>
                    <asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpdatePanel7">
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btnShipStoreTrigger" />
                            <asp:AsyncPostBackTrigger ControlID="btnUpdateShipStore" />
                        </Triggers>
                        <ContentTemplate>
                            <asp:Label runat="server" ID="lblShipStoreTabLoadStatus" Text="Loading..."></asp:Label>
                           <label class="label_vietnam"> Bản dự trữ của tàu:</label><br /><label class="label_english">(Ship's store declaration)</label>
                            <div>
                                <div class="label_english_left">
                                    <asp:Label ID="Label4" runat="server" Text="Nơi để vật tư:" CssClass="label_vietnam"/>
                                    <br /><label class="label_english">(Place of storage)</label>
                                    <br />
                                    <asp:Label ID="Label5" runat="server" Text="Thời gian ở cảng:"  CssClass="label_vietnam"/>
                                    <br />
                                    <label class="label_english">(Period of stay)</label>
                                </div>
                                <div class="label_english_left">
                                    <asp:Label runat="server" ID="lblPlaceOfStorage0"></asp:Label>
                                    <br /><br />
                                     <asp:Label runat="server" ID="lblPeriodOfStay0"></asp:Label>
                                </div>

                                <asp:TextBox runat="server" ID="txtShipStoreDeclarationId" Visible="false" ReadOnly="true" />
                            </div>
                            <div style="clear:both"></div>
                            <label class="b"> Danh sách vật tư (bản dự trữ của tàu):</label>
                            <asp:ImageButton ID="lnkAddShipStore" runat="server" Text="Add" OnClick="lnkAddShipStore_Click"
                                ImageUrl="/_layouts/emanifest/add.png" ToolTip="Thêm dự trữ của tàu" />
                            <asp:ImageButton ID="lnkEditShipStore" runat="server" Text="Edit" OnClick="lnkEditShipStore_Click"
                                ImageUrl="/_layouts/emanifest/edit.png" ToolTip="Thêm dự trữ của tàu" CssClass="edit" />
                            <br />
                            <label class="label_english">(Storage list (Ship's store declaration))</label>

                            <asp:GridView runat="server" ID="grdShipStore" AutoGenerateColumns="false" Width="100%"
                                GridLines="Both" CssClass="GridStyle" AllowPaging="true" PageSize="20" DataKeyNames="ShipStoreItemId" ShowFooter="true" 
                                OnRowUpdating="grdShipStore_RowUpdating"
                                                            OnRowUpdated="grdShipStore_RowUpdated" OnRowEditing="grdShipStore_RowEditing"
                                                            OnRowCancelingEdit="grdShipStore_CancelingEdit" OnRowDeleting="grdShipStore_RowDeleting"
                                                            OnRowDeleted="grdShipStore_RowDeleted" OnRowCommand="grdShipStore_RowCommand">
                                <RowStyle CssClass="GridItem" />
                                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                <PagerStyle CssClass="GridPager" />
                                <HeaderStyle CssClass="GridHeader" />
                                <AlternatingRowStyle CssClass="GridAlternatingItem" />
                                <Columns>
                                    <asp:TemplateField HeaderText="Tên vật tư">
                                        <ItemStyle Width="85%" />
                                        <ItemTemplate>
                                            <%#Eval("Name")%>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:TextBox ID="txtShipStoreName" Text='<%# Eval("Name")%>' runat="server"></asp:TextBox>
                                        </EditItemTemplate>
                                        <FooterTemplate>
                                            <asp:TextBox ID="txtShipStoreName" Text='' runat="server"></asp:TextBox>
                                        </FooterTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Số lượng">
                                        <ItemStyle Width="15%" HorizontalAlign="Right" />
                                        <ItemTemplate>
                                            <%#Eval("Quantity")%>
                                        </ItemTemplate>
                                         <EditItemTemplate>
                                            <asp:TextBox ID="txtShipStoreQuantity" Text='<%# Eval("Quantity")%>' runat="server"> </asp:TextBox>
                                            <asp:RequiredFieldValidator ErrorMessage="required" ControlToValidate="txtShipStoreQuantity" ID="rfvShipStoreQuantityEdit" runat="server" ValidationGroup="vgShipStoreItemEdit">*</asp:RequiredFieldValidator>
                                                                        <asp:RegularExpressionValidator ID="revShipStoreQuantityEdit" runat="server" ControlToValidate="txtShipStoreQuantity"
ErrorMessage="Phải là số" ValidationExpression="^\d+$" ValidationGroup="vgHouseBillItemAdd"></asp:RegularExpressionValidator>
                                        </EditItemTemplate>
                                        <FooterTemplate>
                                            <asp:TextBox ID="txtShipStoreQuantity" Text='' runat="server"></asp:TextBox>
                                            <asp:RequiredFieldValidator ErrorMessage="required" ControlToValidate="txtShipStoreQuantity" ID="rfvShipStoreQuantityAdd" runat="server" ValidationGroup="vgShipStoreItemAdd">*</asp:RequiredFieldValidator>
                                                                        <asp:RegularExpressionValidator ID="revShipStoreQuantityAdd" runat="server" ControlToValidate="txtShipStoreQuantity"
ErrorMessage="Phải là số" ValidationExpression="^\d+$" ValidationGroup="vgHouseBillItemAdd"></asp:RegularExpressionValidator>
                                        </FooterTemplate>
                                    </asp:TemplateField>
                                    <asp:CommandField HeaderText="Sửa" ButtonType="Image" ShowEditButton="True" EditImageUrl="/_layouts/emanifest/edit.png"
                                        CancelImageUrl="/_layouts/emanifest/cancel.png" UpdateImageUrl="/_layouts/emanifest/okay.png" />
                                    <asp:TemplateField HeaderText="Xóa">
                                        <ItemTemplate>
                                            <asp:ImageButton ImageUrl="/_layouts/emanifest/remove.png" CssClass="remove2" ID="linkDeleteShipStore"
                                                CommandName="DeleteShipStore" CommandArgument='<%#Container.DataItemIndex %>'
                                                runat="server"></asp:ImageButton>
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            <asp:ImageButton ImageUrl="/_layouts/emanifest/add.png" ID="linkAddShipStore"
                                                CommandName="AddShipStore" runat="server"></asp:ImageButton>
                                        </FooterTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                            <asp:ObjectDataSource ID="odsShipStore" runat="server" SelectMethod="GetShipStorePagingByDocumentId"
                                EnablePaging="true" TypeName="EMANIFEST.BusinessObjects.Controllers.DocumentControler"
                                StartRowIndexParameterName="startIndex" MaximumRowsParameterName="pageSize" SelectCountMethod="GetShipStoreNumberByDocumentId"
                                OnSelecting="odsShipStore_Selecting"></asp:ObjectDataSource>
                            <asp:Panel ID="pnlShipStore" runat="server" CssClass="popup" Style="display: none">
                                <div class="one-column">
                                    <fieldset>
                                        <legend>
                                            <asp:Label ID="Label3" runat="server" Text="Thông tin về dự trữ của tàu" />
                                        </legend>
                                        <div>
                                            <p>
                                                <asp:Label ID="lblPlaceOfStorage" runat="server" AssociatedControlID="txtPlaceOfStorage"
                                                    Text="Nơi để vật tư" CssClass="label required" />
                                                    <label class="label_english">(Place of storage)</label>
                                                    </p>
                                            <asp:TextBox runat="server" ID="txtPlaceOfStorage" CssClass="validate[required] text-input"
                                                TextMode="MultiLine" Rows="2"></asp:TextBox>
                                            <p>
                                                <asp:Label ID="lblPeriodOfStay" runat="server" AssociatedControlID="txtPeriodOfStay"
                                                    Text="Thời gian ở cảng" CssClass="label required" />
                                                <label class="label_english">(Period of stay)</label>
                                              </p>
                                            <asp:TextBox runat="server" ID="txtPeriodOfStay" CssClass="w100 validate[required] text-input"></asp:TextBox>
                                            <asp:CalendarExtender ID="cPeriodOfStay" runat="server" TargetControlID="txtPeriodOfStay"
                                                Format="dd/MM/yyyy" OnClientShown="calendarShown" PopupButtonID="imgPeriodOfStay">        
                            </asp:CalendarExtender>                        
                            <asp:Image ID="imgPeriodOfStay" runat="server" ImageUrl="~/_layouts/emanifest/calendar.png" />
                                        </div>
                                    </fieldset>
                                    <fieldset>
                                        <asp:Label runat="server" ID="lblShipStoreError"></asp:Label>
                                        <br />
                                        <asp:Button CssClass="button submit" ID="btnUpdateShipStore" CommandName="Update"
                                            runat="server" Text="Cập nhật" OnClick="btnUpdateShipStore_Click" CausesValidation="true" />
                                        <asp:Button CssClass="button" ID="btnShipStoreCancel" runat="server" Text="Bỏ qua"
                                            OnClientClick="btnCancel_OnClientClick(); return false;" />
                                    </fieldset>
                                </div>
                            </asp:Panel>
                            <asp:Button CssClass="button" ID="btnShowPopupShipStore" runat="server" Style="display: none" />
                            <asp:ModalPopupExtender ID="popupShipStore" runat="server" TargetControlID="btnShowPopupShipStore"
                                PopupControlID="pnlShipStore" BackgroundCssClass="modalBackground" DropShadow="false">
                            </asp:ModalPopupExtender>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </ContentTemplate>
            </asp:TabPanel>

            <asp:TabPanel ID="TabPanel6" runat="server" HeaderText="Danh sách hành khách" ToolTip="Passenger list">
                <ContentTemplate>
                    <div>
                        <uc1:UploadFile ID="upFilePassenger" runat="server" />
                    </div>
                    <asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpdatePanel5">
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btnPassengerTrigger" />
                             <asp:AsyncPostBackTrigger ControlID="grdPassenger" />
                            <asp:AsyncPostBackTrigger ControlID="btnUpdatePassenger" />
                        </Triggers>
                        <ContentTemplate>
                            <asp:Label runat="server" ID="lblPassengerTabLoadStatus" Text="Loading..."></asp:Label>
                           <label class="label_vietnam"> Danh sách hành khách:</label>
                            <asp:ImageButton ID="lnkAddPassenger" runat="server" Text="Add" OnClick="lnkAddPassenger_Click"
                                ImageUrl="/_layouts/emanifest/add.png" ToolTip="Thêm hành khách" />
                                <br /><label class="label_english">(Passenger list)</label>
                            <asp:GridView runat="server" ID="grdPassenger" AutoGenerateColumns="false" Width="100%"
                                GridLines="Both" CssClass="GridStyle" AllowPaging="true" PageSize="20"  DataKeyNames="PassengerId, StateId,PassportType"
                                 OnRowCommand="grdPassenger_RowCommand">
                                <PagerSettings Mode="NumericFirstLast" PageButtonCount="10" FirstPageText="Trang đầu"
                                    LastPageText="Trang cuối" />
                                <RowStyle CssClass="GridItem" />
                                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                <PagerStyle CssClass="GridPager" />
                                <HeaderStyle CssClass="GridHeader" />
                                <AlternatingRowStyle CssClass="GridAlternatingItem" />
                                <Columns>
                                    <asp:BoundField DataField="FamilyName" HeaderText="Họ" HtmlEncode="true" />
                                    <asp:BoundField DataField="GivenName" HeaderText="Tên hành khách" HtmlEncode="true" />
                                    <asp:BoundField DataField="BirthDate" HeaderText="Ngày sinh" HtmlEncode="true" ItemStyle-HorizontalAlign="Right"
                                        DataFormatString="{0:dd/MM/yyyy}" />
                                    <asp:BoundField DataField="BirthPlace" HeaderText="Nơi sinh" HtmlEncode="true" />
                                    <asp:BoundField DataField="StateId" Visible="false" />
                                    <asp:TemplateField HeaderText="Quốc tịnh">
                                        <ItemTemplate>
                                            <%#Eval("State.Name")%>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="PassportType" Visible="false" />
                                    <asp:TemplateField HeaderText="Loại hộ chiếu">
                                        <ItemTemplate>
                                            <%#Eval("PassportTypeDto.Description")%>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="PassportNumber" HeaderText="Số hộ chiếu" HtmlEncode="true"
                                        ItemStyle-HorizontalAlign="Right" />
                                    <asp:BoundField DataField="PassportValidDate" HeaderText="Ngày hết hạn" HtmlEncode="true"
                                        ItemStyle-HorizontalAlign="Right" DataFormatString="{0:dd/MM/yyyy}" />
                                    <asp:BoundField DataField="PortNameOfEmbarkation" HeaderText="Cảng lên tàu" HtmlEncode="true" />
                                    <asp:BoundField DataField="PortNameOfDisembarkation" HeaderText="Cảng rời tàu" HtmlEncode="true" />
                                    <asp:BoundField DataField="IsTransit" Visible="false" />
                                    <asp:TemplateField HeaderText="Quá cảnh">
                                        <ItemTemplate>
                                            <asp:CheckBox ID="chkBoxIsTransit" runat="server" Checked='<%#Eval("IsTransit")%>'
                                                Enabled="false" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Sửa">
                                        <ItemStyle CssClass="actionlink" Width="30px" VerticalAlign="Middle" />
                                        <ItemTemplate>
                                            <asp:ImageButton ImageUrl="/_layouts/emanifest/edit.png" runat="server" CssClass="edit"
                                                ID="lnkSua" Text="Edit" CommandName="imgedit" CommandArgument='<%#Container.DataItemIndex %>' />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Xóa">
                                        <ItemStyle CssClass="actionlink" Width="30px" VerticalAlign="Middle" />
                                        <ItemTemplate>
                                            <asp:ImageButton ImageUrl="/_layouts/emanifest/remove.png" runat="server" CssClass="remove2"
                                                ID="lnkXoa" Text="Xóa" CommandName="imgremove" CommandArgument='<%#Container.DataItemIndex %>' />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                            <asp:ObjectDataSource ID="odsPassenger" runat="server" SelectMethod="GetPassengerPagingByDocumentId"
                                EnablePaging="true" TypeName="EMANIFEST.BusinessObjects.Controllers.DocumentControler"
                                StartRowIndexParameterName="startIndex" MaximumRowsParameterName="pageSize" SelectCountMethod="GetPassengerNumberByDocumentId"
                                OnSelecting="odsPassenger_Selecting"></asp:ObjectDataSource>
                            <asp:Button CssClass="button" ID="btnShowPopupPassenger" runat="server" Style="display: none" />
                            <asp:ModalPopupExtender ID="popupPassenger" runat="server" TargetControlID="btnShowPopupPassenger"
                                PopupControlID="pnlAddPassenger" BackgroundCssClass="modalBackground" DropShadow="false">
                            </asp:ModalPopupExtender>

                            <div>
                                <asp:Panel ID="pnlAddPassenger" runat="server" CssClass="popup" Style="display: none">
                                    <div class="two-columns">
                                        <fieldset>
                                            <legend>
                                                <asp:Label ID="Label18" runat="server" Text="Thông tin về hành khách" />
                                            </legend>
                                            <div class="left-column">
                                                <p>
                                                    <asp:Label ID="lblPassengerHo" runat="server" AssociatedControlID="txtPassengerHo"
                                                        Text="Họ" CssClass="label required" />
                                                        <label class="label_english">(Family name)</label>
                                                </p>
                                                <asp:TextBox runat="server" ID="txtPassengerHo" CssClass="w200  validate[required] text-input"></asp:TextBox>
                                                <p>
                                                    <asp:Label ID="lblPassengerTen" runat="server" AssociatedControlID="txtPassengerTen"
                                                        Text="Tên hành khách" CssClass="label required" />
                                                        <label class="label_english">(Given name)</label>
                                                        </p>
                                                <asp:TextBox runat="server" ID="txtPassengerTen" CssClass="w200 validate[required] text-input"></asp:TextBox>
                                                <p>
                                                    <asp:Label ID="lblPassengerNgaySinh" runat="server" 
                                                        Text="Ngày sinh:" CssClass="label required" />
                                                        <label class="label_english">(Date of birth)</label>
                                                </p>
                                                <asp:TextBox runat="server" ID="txtPassengerNgaySinh" CssClass="w100 validate[required] text-input"></asp:TextBox>
                                                <asp:CalendarExtender ID="cPassengerNgaySinh" runat="server" TargetControlID="txtPassengerNgaySinh"
                                                    BehaviorID="cPassengerNgaySinhID" Format="dd/MM/yyyy"  OnClientShown="calendarShown" PopupButtonID="imgPassengerNgaySinh">        
                            </asp:CalendarExtender>                        
                            <asp:Image ID="imgPassengerNgaySinh" runat="server" ImageUrl="~/_layouts/emanifest/calendar.png" />
                                                
                                                <p>
                                                    <asp:Label ID="lblPassengerNoiSinh" runat="server" AssociatedControlID="txtPassengerNoiSinh"
                                                        Text="Nơi sinh:" CssClass="label required" />
                                                        <label class="label_english">(Place of date)</label>
                                                </p>
                                                <asp:TextBox runat="server" ID="txtPassengerNoiSinh" CssClass="w200 validate[required]"></asp:TextBox>
                                                <p>
                                                    <asp:Label ID="lblBoxPassengerIsTransit" runat="server" AssociatedControlID="chkBoxPassengerIsTransit"
                                                        Text="Quá cảnh" CssClass="label required" />
                                                        <label class="label_english">(Transit passenger or not)</label>
                                                        </p>
                                                <asp:CheckBox ID="chkBoxPassengerIsTransit" runat="server" Checked="false" />

                                            </div>
                                            <div class="right-column">                                                
                                                <p>
                                                    <asp:Label ID="lblPassengerQuocTich" runat="server" AssociatedControlID="ddlPassengerQuocTich"
                                                        Text="Quốc tịch" CssClass="label required" />
                                                         <label class="label_english">(Nationality)</label>
                                                        </p>
                                                <asp:DropDownList runat="server" ID="ddlPassengerQuocTich" CssClass="w200 validate[required]"
                                                    DataTextField="Name" DataValueField="StateId">
                                                </asp:DropDownList>
                                                <p>
                                                    <asp:Label ID="lblPassengerLoaiHoChieu" runat="server" AssociatedControlID="ddlPassengerLoaiHoChieu"
                                                        Text="Loại hộ chiếu:" CssClass="label required" />
                                                        <label class="label_english">(Type of identity document)</label>
                                                </p>
                                                <asp:DropDownList runat="server" ID="ddlPassengerLoaiHoChieu" CssClass="w200 validate[required]"
                                                    DataTextField="Description" DataValueField="PassportType">
                                                </asp:DropDownList>
                                                <p>
                                                    <asp:Label ID="lblPassengerSoHoChieu" runat="server" AssociatedControlID="txtPassengerSoHoChieu"
                                                        Text="Số hộ chiếu" CssClass="label required" />
                                                        <label class="label_english">(Serial number of identity document)</label>
                                                        </p>
                                                <asp:TextBox runat="server" ID="txtPassengerSoHoChieu" CssClass="w200 validate[required]"></asp:TextBox>
                                                <p>
                                                    <asp:Label ID="lblPassengerNgayHetHan" runat="server"
                                                        Text="Ngày hết hạn hộ chiếu" CssClass="label required" />
                                                        <label class="label_english">(Expires)</label>
                                                        </p>
                                                <asp:TextBox runat="server" ID="txtPassengerNgayHetHan" CssClass="w100 validate[required] text-input"></asp:TextBox>
                                                <asp:CalendarExtender ID="cPassengerNgayHetHan" runat="server" TargetControlID="txtPassengerNgayHetHan"
                                                    BehaviorID="cPassengerNgayHetHanID" Format="dd/MM/yyyy"  OnClientShown="calendarShown" PopupButtonID="imgPassengerNgayHetHan">        
                            </asp:CalendarExtender>                        
                            <asp:Image ID="imgPassengerNgayHetHan" runat="server" ImageUrl="~/_layouts/emanifest/calendar.png" />
                                                <p>
                                                    <asp:Label ID="lblPassengerPortNameOfEmbarkation" runat="server" AssociatedControlID="txtPassengerPortNameOfEmbarkation"
                                                        Text="Cảng lên tàu" CssClass="label required" />
                                                        <label class="label_english">(Port of embarkation)</label>
                                                </p>
                                                <asp:TextBox runat="server" ID="txtPassengerPortNameOfEmbarkation" CssClass="w200 validate[required]"></asp:TextBox>
                                                 <p>
                                                    <asp:Label ID="lblPassengerPortNameOfDisembarkation" runat="server" AssociatedControlID="txtPassengerPortNameOfDisembarkation"
                                                        Text="Cảng rời tàu" CssClass="label required" />
                                                        <label class="label_english">(Port of disembarkation )</label>
                                                </p>
                                                <asp:TextBox runat="server" ID="txtPassengerPortNameOfDisembarkation" CssClass="w200 validate[required]"></asp:TextBox>  
                                            </div>
                                        </fieldset>
                                        <fieldset>
                                            <asp:TextBox runat="server" ID="txtPassengerId" ReadOnly="true" Visible="false" />
                                            <asp:Label runat="server" ID="lblPassengerError"></asp:Label>
                                            <br />
                                            <asp:Button CssClass="button submit" ID="btnUpdatePassenger" CommandName="Update"
                                                runat="server" Text="Cập nhật" OnClick="btnUpdatePassenger_Click" />
                                            <asp:Button CssClass="button" ID="btnPassengerCancel" runat="server" Text="Bỏ qua"
                                                OnClientClick="btnCancel_OnClientClick(); return false;" />
                                        </fieldset>
                                    </div>
                                </asp:Panel>
                            </div>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </ContentTemplate>
            </asp:TabPanel>



            <asp:TabPanel ID="TabPanel7" runat="server" HeaderText="BK hàng hóa nguy hiểm" ToolTip="Good dangerous">
                <HeaderTemplate>
                    BK hàng hóa nguy hiểm
                </HeaderTemplate>
                <ContentTemplate>
                <div>
                        <uc1:UploadFile ID="upFileDangerousGood" runat="server" />
                    </div>
                    <asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpdatePanel6">
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btnDangerousGoodTrigger" />
                            <asp:AsyncPostBackTrigger ControlID="grdDangerousGood" />
                            <asp:AsyncPostBackTrigger ControlID="btnUpdateDangerousGood" />
                            <asp:AsyncPostBackTrigger ControlID="btnUpdateDangerousGoodItem" />
                            
                        </Triggers>
                        <ContentTemplate>
                            <asp:Label runat="server" ID="lblDangerousGoodLoadStatus" Text="Loading..."></asp:Label>
                            <asp:Label runat="server" ID="lblDangerousGoodLoadStatus0"></asp:Label>
                                            <asp:TextBox runat="server" ID="txtDangerousGoodItemPageIndex" ReadOnly="true" Visible="false" />
                                            <asp:TextBox runat="server" ID="txtDangerousGoodItemEditIndex" ReadOnly="true" Visible="false" />
                                            <asp:TextBox runat="server" ID="txtDangerousGoodItemUniqueID" ReadOnly="true" Visible="false" />
                            <label class="label_vietnam"> BK hàng hóa nguy hiểm:</label><asp:ImageButton ID="lnkAddDangerousGood" runat="server" Text="Add"
                                OnClick="lnkAddDangerousGood_Click" ImageUrl="/_layouts/emanifest/add.png" ToolTip="Thêm hàng hóa nguy hiểm" Visible="False"  />
                                <br /><label class="label_english">(Dangerous goods manifest)</label>
                            <asp:GridView runat="server" ID="grdDangerousGood" AutoGenerateColumns="False" Width="100%"
                                CssClass="Grid GridStyle" GridLines="Both" AllowPaging="true" PageSize="20" EnableModelValidation="True"
                                OnSelectedIndexChanged="grdDangerousGood_SelectedIndexChanged" OnRowCommand="grdDangerousGood_RowCommand"
                                OnRowDataBound="grdDangerousGood_RowDataBound"
                                DataKeyNames="DangerousGoodId">
                                <PagerSettings Mode="NumericFirstLast" PageButtonCount="10" FirstPageText="Trang đầu"
                                    LastPageText="Trang cuối" />
                                <RowStyle CssClass="GridItem" />
                                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                <PagerStyle CssClass="GridPager" />
                                <HeaderStyle CssClass="GridHeader" />
                                <AlternatingRowStyle CssClass="GridAlternatingItem" />
                                <Columns>
                                    <asp:CommandField SelectImageUrl="~/_layouts/emanifest/plus.png" ShowSelectButton="true"
                                        ButtonType="Image" SelectText="">
                                        <HeaderStyle HorizontalAlign="Center" />
                                        <ItemStyle HorizontalAlign="Center" />
                                    </asp:CommandField>
                                    <asp:BoundField DataField="ContNumber" HeaderText="Số hiệu cont" />
                                    <asp:BoundField DataField="ContSealNumber" HeaderText="Số seal cont" />
                                    <asp:BoundField DataField="PortNameOfLoad" HeaderText="Cảng nhận hàng" HtmlEncode="true" />
                                    <asp:BoundField DataField="PortNameOfUnload" HeaderText="Cảng trả hàng" HtmlEncode="true" />
                                    <asp:TemplateField HeaderText="Sửa">
                                        <ItemStyle CssClass="actionlink" Width="20px" VerticalAlign="Middle" />
                                        <ItemTemplate>
                                            <asp:ImageButton ImageUrl="/_layouts/emanifest/edit.png" runat="server" CssClass="edit"
                                                ID="lnkSua" Text="Edit" CommandName="imgedit" CommandArgument='<%#Container.DataItemIndex %>' />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Xóa">
                                        <ItemStyle CssClass="actionlink" Width="20px" VerticalAlign="Middle" />
                                        <ItemTemplate>
                                            <asp:ImageButton ImageUrl="/_layouts/emanifest/remove.png" runat="server" CssClass="remove2"
                                                ID="lnkXoa" Text="Xóa" CommandName="imgremove" CommandArgument='<%#Container.DataItemIndex %>' />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <tr>
                                                <td colspan="100%">
                                                    <div id="div<%# Eval("ContNumber") %>" style="display: block; position: relative;
                                                        left: 15px; overflow: auto; width: 97%">
                                                        <asp:GridView runat="server" ID="grdDangerousGoodItem" AutoGenerateColumns="False"
                                                            Width="100%" CssClass="Grid GridStyle" GridLines="Both" AllowPaging="true" PageSize="20"
                                                            EnableModelValidation="True" DataKeyNames="DangerousGoodItemId, DangerousGoodId"
                                                            ShowFooter="true"
                                                            OnRowCommand="grdDangerousGoodItem_RowCommand">
                                                            <PagerSettings Mode="NumericFirstLast" PageButtonCount="10" FirstPageText="Trang đầu"
                                                                LastPageText="Trang cuối" />
                                                            <RowStyle CssClass="GridItem" />
                                                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                                            <PagerStyle CssClass="GridPager" />
                                                            <HeaderStyle CssClass="GridHeader" />
                                                            <AlternatingRowStyle CssClass="GridAlternatingItem" />
                                                            <Columns>
                                                                <asp:BoundField DataField="RefNumber" HeaderText="Số vận đơn"></asp:BoundField>
                                                                <asp:BoundField DataField="NumberContainer" HeaderText="Kí hiệu"></asp:BoundField>
                                                                <asp:BoundField DataField="NumberOfPackage" HeaderText="Số kiện" ItemStyle-HorizontalAlign="Right">
                                                                </asp:BoundField>
                                                                <asp:BoundField DataField="ProperShipping" HeaderText="Công ty vận chuyển"></asp:BoundField>
                                                                <asp:BoundField DataField="GoodClass" HeaderText="Loại hàng hóa"></asp:BoundField>
                                                                <asp:BoundField DataField="UNNumber" HeaderText="Số UN" ItemStyle-HorizontalAlign="Right">
                                                                </asp:BoundField>
                                                                <asp:BoundField DataField="PackingGroup" HeaderText="Nhóm hàng "></asp:BoundField>
                                                                <asp:BoundField DataField="SubsidiaryRisk" HeaderText="Nhóm phụ số"></asp:BoundField>
                                                                <asp:BoundField DataField="FlashPoint" HeaderText="Điểm bốc cháy" ItemStyle-HorizontalAlign="Right"
                                                                    FooterStyle-Width="40px"></asp:BoundField>
                                                                <asp:BoundField DataField="MarinePollutant" HeaderText="Ô nhiễm biển"></asp:BoundField>
                                                                <asp:BoundField DataField="GrossWeight" HeaderText="Tổng khối lượng" ItemStyle-HorizontalAlign="Right"
                                                                    FooterStyle-Width="40px"></asp:BoundField>
                                                                <asp:BoundField DataField="StowagePosition" HeaderText="Vị trí xếp hàng"></asp:BoundField>
                                                                <asp:TemplateField HeaderText="Sửa">
                                                                    <ItemStyle CssClass="actionlink" Width="30px" VerticalAlign="Middle" />
                                                                    <ItemTemplate>
                                                                        <asp:ImageButton ImageUrl="/_layouts/emanifest/edit.png" runat="server" CssClass="edit"
                                                                            ID="lnkSua" Text="Edit" CommandName="imgedit" CommandArgument='<%#Container.DataItemIndex %>' />
                                                                    </ItemTemplate>
                                                                </asp:TemplateField>
                                                                <asp:TemplateField HeaderText="Xóa">
                                                                    <ItemStyle Width="20px" />
                                                                    <ItemTemplate>
                                                                        <asp:ImageButton ImageUrl="/_layouts/emanifest/remove.png" CssClass="remove2" ID="linkDeleteDangerousGoodItem"
                                                                            CommandName="Delete" CommandArgument='<%#Container.DataItemIndex %>'
                                                                            runat="server"></asp:ImageButton>
                                                                    </ItemTemplate>
                                                                    <FooterTemplate>
                                                                        <asp:ImageButton ImageUrl="/_layouts/emanifest/add.png" ID="linkAddDangerousGoodItem"
                                                                            CommandName="AddDangerousGoodItem" runat="server"></asp:ImageButton>
                                                                    </FooterTemplate>
                                                                </asp:TemplateField>                                                                
                                                            </Columns>                                                                                                                 
                                                        </asp:GridView>
                                                    </div>
                                                </td>
                                            </tr>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                            <asp:ObjectDataSource ID="odsDangerousGood" runat="server" SelectMethod="GetDangerousGoodPagingByDocumentId"
                                EnablePaging="true" TypeName="EMANIFEST.BusinessObjects.Controllers.DocumentControler"
                                StartRowIndexParameterName="startIndex" MaximumRowsParameterName="pageSize" SelectCountMethod="GetDangerousGoodNumberByDocumentId"
                                OnSelecting="odsDangerousGood_Selecting"></asp:ObjectDataSource>
                            <asp:ObjectDataSource ID="odsDangerousGoodItem" runat="server" SelectMethod="GetDangerousGoodItemPagingByDangerousGoodId"
                                EnablePaging="true" TypeName="EMANIFEST.BusinessObjects.Controllers.DocumentControler"
                                StartRowIndexParameterName="startIndex" MaximumRowsParameterName="pageSize" SelectCountMethod="GetDangerousGoodItemNumberByDangerousGoodId"
                                OnSelecting="odsDangerousGoodItem_Selecting" OnSelected="odsDangerousGoodItem_Selected">
                                <SelectParameters>
                                    <asp:Parameter Name="dangerousGoodId" Type="String" DefaultValue="" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                            <asp:Button CssClass="button" ID="btnShowPopupDangerousGood" runat="server" Style="display: none" />
                            <asp:ModalPopupExtender ID="popupDangerousGood" runat="server" TargetControlID="btnShowPopupDangerousGood"
                                PopupControlID="pnlAddDangerousGood" BackgroundCssClass="modalBackground" DropShadow="false">
                            </asp:ModalPopupExtender>
                            <div>
                                <asp:Panel ID="pnlAddDangerousGood" runat="server" CssClass="popup" Style="display: none">
                                    <div class="one-column">
                                        <fieldset>
                                            <legend>
                                                <asp:Label ID="Label19" runat="server" Text="Thông tin hàng hóa nguy hiểm" />
                                            </legend>
                                            <p>
                                                <asp:Label ID="lblDangerousContNumber" runat="server" AssociatedControlID="txtDangerousContNumber"
                                                    Text="Số hiệu container" CssClass="label required" />
                                                    <label class="label_english">(Number container)</label>
                                            </p>
                                            <asp:TextBox runat="server" ID="txtDangerousContNumber" CssClass="w100  validate[required] text-input"></asp:TextBox>
                                            <p>
                                                <asp:Label ID="lblDangerousContSealNumber" runat="server" AssociatedControlID="txtDangerousContSealNumber"
                                                    Text="Số seal container" CssClass="label required" />
                                                    <label class="label_english">(Number seal container)</label>
                                                    </p>
                                            <asp:TextBox runat="server" ID="txtDangerousContSealNumber" CssClass="w100 validate[required] text-input"></asp:TextBox>
                                            <p>
                                                <asp:Label ID="lblDangerousGoodPortOfLoad" runat="server" AssociatedControlID="txtDangerousGoodPortOfLoad"
                                                    Text="Cảng nhận hàng" CssClass="label required" />
                                                    <label class="label_english">(Port of loading)</label>
                                                    </p>
                                            <asp:TextBox runat="server" ID="txtDangerousGoodPortOfLoad" CssClass="w200  validate[required] text-input"></asp:TextBox>
                                            <p>
                                                <asp:Label ID="lblDangerousGoodPortOfUnload" runat="server" AssociatedControlID="txtDangerousGoodPortOfUnload"
                                                    Text="Cảng dỡ hàng (Port of unloading)" CssClass="label required" />
                                                    <label class="label_english">(Port of unloading)</label>
                                                    </p>
                                            <asp:TextBox runat="server" ID="txtDangerousGoodPortOfUnload" CssClass="w200  validate[required] text-input"></asp:TextBox>
                                        </fieldset>
                                        <fieldset>
                                            <asp:TextBox runat="server" ID="txtDangerousGoodId" ReadOnly="true" Visible="false" />
                                            <asp:Label runat="server" ID="lblDangerousGoodError" Text=""></asp:Label>
                                            <br />
                                            <asp:Button CssClass="button submit" ID="btnUpdateDangerousGood" CommandName="Update"
                                                runat="server" Text="Cập nhật" OnClick="btnUpdateDangerousGood_Click" />
                                            <asp:Button CssClass="button" ID="btnDangerouGoodCancel" runat="server" Text="Bỏ qua" OnClientClick="btnCancel_OnClientClick(); return false;" />
                                        </fieldset>
                                    </div>
                                </asp:Panel>
                            </div>

                            <asp:Button CssClass="button" ID="btnShowPopupDangerousGoodItem" runat="server" Style="display: none" />
                            <asp:ModalPopupExtender ID="popupDangerousGoodItem" runat="server" TargetControlID="btnShowPopupDangerousGoodItem"
                                PopupControlID="pnlAddDangerousGoodItem" BackgroundCssClass="modalBackground" DropShadow="false">
                            </asp:ModalPopupExtender>
                            <div>
                                <asp:Panel ID="pnlAddDangerousGoodItem" runat="server" CssClass="popup" Style="display: none">
                                    <div class="two-columns">
                                        <fieldset>
                                            <legend>
                                                <asp:Label ID="Label24" runat="server" Text="Thông tin hàng hóa nguy hiểm" />
                                            </legend>
                                            <div class="left-column">
                                                <p>
                                                    <asp:Label ID="lblDangerousGoodItemRefNumber" runat="server" AssociatedControlID="txtDangerousGoodItemRefNumber"
                                                        Text="Số vận đơn" CssClass="label required" />
                                                        <label class="label_english">(Booking/reference number)</label>
                                                </p>
                                                <asp:TextBox runat="server" ID="txtDangerousGoodItemRefNumber" CssClass="w100  validate[required] text-input"></asp:TextBox>
                                                <p>
                                                    <asp:Label ID="lblDangerousGoodItemNumberContainer" runat="server" AssociatedControlID="txtDangerousGoodItemNumberContainer"
                                                        Text="Kí hiệu container" CssClass="label required" />
                                                         <label class="label_english">(Marks)</label>
                                                        </p>
                                                <asp:TextBox runat="server" ID="txtDangerousGoodItemNumberContainer" CssClass="w100  validate[required] text-input"></asp:TextBox>
                                                <p>
                                                    <asp:Label ID="lblDangerousGoodItemNumberOfPackage" runat="server" AssociatedControlID="txtDangerousGoodItemNumberOfPackage"
                                                        Text="Số kiện" CssClass="label required" />
                                                        <label class="label_english">(Number container)</label>
                                                        </p>
                                                <asp:TextBox runat="server" ID="txtDangerousGoodItemNumberOfPackage" CssClass="w100  validate[required] text-input"></asp:TextBox>
                                                <p>
                                                    <asp:Label ID="lblDangerousGoodItemProperShipping" runat="server" AssociatedControlID="txtDangerousGoodItemProperShipping"
                                                        Text="Công ty vận chuyển" CssClass="label required" />
                                                        <label class="label_english">(Proper shipping name)</label>
                                                        </p>
                                                <asp:TextBox runat="server" ID="txtDangerousGoodItemProperShipping" CssClass="validate[required] text-input" TextMode="MultiLine" Rows="4"></asp:TextBox>
                                                <p>
                                                    <asp:Label ID="lblDangerousGoodItemGoodClass" runat="server" AssociatedControlID="txtDangerousGoodItemGoodClass"
                                                        Text="Loại hàng hóa" CssClass="label required" />
                                                        <label class="label_english">(Class)</label>
                                                        </p>
                                                <asp:TextBox runat="server" ID="txtDangerousGoodItemGoodClass" CssClass="w100  validate[required] text-input"></asp:TextBox>
                                                <p>
                                                    <asp:Label ID="lblDangerousGoodItemUNNumber" runat="server" AssociatedControlID="txtDangerousGoodItemUNNumber"
                                                        Text="Số UN" CssClass="label required" />
                                                        <label class="label_english">(UN number)</label>
                                                        </p>
                                                <asp:TextBox runat="server" ID="txtDangerousGoodItemUNNumber" CssClass="w100 validate[required] text-input"></asp:TextBox>
                                            </div>
                                            <div class="right-column">
                                                <p>
                                                    <asp:Label ID="lblDangerousGoodItemPackingGroup" runat="server" AssociatedControlID="txtDangerousGoodItemPackingGroup"
                                                        Text="Nhóm hàng" CssClass="label required" />
                                                        <label class="label_english">(Packing group)</label>
                                                        </p>
                                                <asp:TextBox runat="server" ID="txtDangerousGoodItemPackingGroup" CssClass="w200  validate[required] text-input"></asp:TextBox>
                                                <p>
                                                    <asp:Label ID="lblDangerousGoodItemSubsidiaryRisk" runat="server" AssociatedControlID="txtDangerousGoodItemSubsidiaryRisk"
                                                        Text="Nhóm phụ số" CssClass="label required" />
                                                        <label class="label_english">(Subsidiary risk)</label>
                                                        </p>
                                                <asp:TextBox runat="server" ID="txtDangerousGoodItemSubsidiaryRisk" CssClass="w200  validate[required] text-input"></asp:TextBox>
                                                <p>
                                                    <asp:Label ID="lblDangerousGoodItemFlashPoint" runat="server" AssociatedControlID="txtDangerousGoodItemFlashPoint"
                                                        Text="Điểm bốc cháy" CssClass="label required" />
                                                        <label class="label_english">(Flash point)</label>
                                                        </p>
                                                <asp:TextBox runat="server" ID="txtDangerousGoodItemFlashPoint" CssClass="w100  validate[required] text-input"></asp:TextBox>
                                                <p>
                                                    <asp:Label ID="lblDangerousGoodItemMarinePollutant" runat="server" AssociatedControlID="txtDangerousGoodItemMarinePollutant"
                                                        Text="Ô nhiễm biển" CssClass="label required" />
                                                        <label class="label_english">(Marine pollutant)</label>
                                                        </p>
                                                <asp:TextBox runat="server" ID="txtDangerousGoodItemMarinePollutant" CssClass="w100  validate[required] text-input"></asp:TextBox>
                                                <p>
                                                    <asp:Label ID="lblDangerousGoodItemGrossWeight" runat="server" AssociatedControlID="txtDangerousGoodItemGrossWeight"
                                                        Text="Tổng khối lượng" CssClass="label required" />
                                                        <label class="label_english">(Mass (kg) Gross/Net)</label>
                                                        </p>
                                                <asp:TextBox runat="server" ID="txtDangerousGoodItemGrossWeight" CssClass="w100  validate[required] text-input"></asp:TextBox>
                                                <p>
                                                    <asp:Label ID="lblDangerousGoodItemStowagePosition" runat="server" AssociatedControlID="txtDangerousGoodItemStowagePosition"
                                                        Text="Vị trí xếp hàng" CssClass="label required" />
                                                         <label class="label_english">(Stowage position on board)</label>
                                                        </p>
                                                <asp:TextBox runat="server" ID="txtDangerousGoodItemStowagePosition" CssClass="validate[required] text-input" TextMode="MultiLine" Rows="4"></asp:TextBox>
                                            </div>
                                        </fieldset>
                                        <fieldset>
                                            <asp:TextBox runat="server" ID="txtDangerousGoodItemId" ReadOnly="true" Visible="false" />
                                            
                                            <asp:Label runat="server" ID="lblDangerousGoodItemError" Text=""></asp:Label>
											
                                            <br />
                                            <asp:Button CssClass="button submit" ID="btnUpdateDangerousGoodItem" CommandName="Update"
                                                runat="server" Text="Cập nhật" OnClick="btnUpdateDangerousGoodItem_Click" />
                                            <asp:Button CssClass="button" ID="btnDangerousGoodItemCancel" runat="server" Text="Bỏ qua"
                                                OnClientClick="btnCancel_OnClientClick(); return false;" />
                                        </fieldset>
                                    </div>
                                </asp:Panel>
                            </div>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </ContentTemplate>
            </asp:TabPanel>

            <asp:TabPanel ID="TabPanel8" runat="server" HeaderText="Master bill">
                <ContentTemplate>
                    <asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpdatePanel1">
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btnMasterBillTrigger" />
                        </Triggers>
                        <ContentTemplate>
                            <asp:Label runat="server" ID="lblMasterBillTabLoadStatus" Text="Loading..."></asp:Label>
                            <asp:GridView runat="server" ID="grdMasterBill" AutoGenerateColumns="False" Width="100%"
                                CssClass="Grid GridStyle" GridLines="Both" AllowPaging="true" PageSize="20" EnableModelValidation="True"
                                EmptyDataText="No data">
                                <RowStyle CssClass="GridItem" />
                                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                <PagerStyle CssClass="GridPager" />
                                <HeaderStyle CssClass="GridHeader" />
                                <AlternatingRowStyle CssClass="GridAlternatingItem" />
                                <Columns>
                                    <asp:TemplateField HeaderText="Vận đơn số">
                                        <ItemTemplate>
                                            <%#Eval("MasterBillNo")%>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Người gửi">
                                        <ItemTemplate>
                                            <%#Eval("Consigner")%>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Người nhận">
                                        <ItemTemplate>
                                            <%#Eval("Consignee")%>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Người được thông báo">
                                        <ItemTemplate>
                                            <%#Eval("NotificatedParty")%>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Đại lý giao nhận">
                                        <ItemTemplate>
                                            <%#Eval("FreightForwarder")%>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Cảng dỡ hàng">
                                        <ItemTemplate>
                                            <%#Eval("PortOfDischarge")%>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Cảng đích">
                                        <ItemTemplate>
                                            <%#Eval("PortOfDestination")%>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Cảng xếp hàng">
                                        <ItemTemplate>
                                            <%#Eval("PortOfLoading")%>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Cảng xếp hàng gốc">
                                        <ItemTemplate>
                                            <%#Eval("PortOfOrginalLoading")%>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Cảng trung chuyển">
                                        <ItemTemplate>
                                            <%#Eval("PlaceOfDispach")%>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <EmptyDataTemplate>
<asp:Label ID="lbl_RecordNotFound" Text="No Record Found" runat="server" Font-Size="Larger" ForeColor="maroon" ></asp:Label>
</EmptyDataTemplate>
                            </asp:GridView>
                            <asp:ObjectDataSource ID="odsMasterBill" runat="server" SelectMethod="GetMasterBillPagingByDocumentId"
                                EnablePaging="true" TypeName="EMANIFEST.BusinessObjects.Controllers.DocumentControler"
                                StartRowIndexParameterName="startIndex" MaximumRowsParameterName="pageSize" SelectCountMethod="GetMasterBillNumberByDocumentId"
                                OnSelecting="odsMasterBill_Selecting"></asp:ObjectDataSource>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </ContentTemplate>
            </asp:TabPanel>
            <asp:TabPanel ID="TabPanel9" runat="server" HeaderText="Master Bill image" Visible="false">
                <ContentTemplate>
                    <asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpdatePanel10">
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btnImgMasterBillTrigger" />
                        </Triggers>
                        <ContentTemplate>
                            <asp:Label runat="server" ID="lblImgMasterBillTabLoadStatus" Text="Loading..."></asp:Label>
                            <asp:Image ID="imgMasterBill" runat="server" ImageUrl="../../../_layouts/handlers/BillImageHandler.ashx" />
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </ContentTemplate>
            </asp:TabPanel>
            <asp:TabPanel ID="TabPanel10" runat="server" HeaderText="House Bill image" Visible="false">
                <ContentTemplate>
                    <asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpdatePanel9">
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btnImgHouseBillTrigger" />
                        </Triggers>
                        <ContentTemplate>
                            <asp:Label runat="server" ID="lblImgHouseBillTabLoadStatus" Text="Loading..."></asp:Label>
                            <asp:Image ID="imgHouseBill" runat="server" ImageUrl="../../../_layouts/handlers/BillImageHandler.ashx" />
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </ContentTemplate>
            </asp:TabPanel>
        </asp:TabContainer>
    </div>
</div>
